mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
Display if broadcast was cancelled via API
If broadcast_message has no value under cancelled_by_id, display in the view that it was cancelled by an API call.
This commit is contained in:
@@ -181,7 +181,9 @@ class BroadcastMessage(JSONModel):
|
||||
|
||||
@cached_property
|
||||
def cancelled_by(self):
|
||||
return User.from_id(self.cancelled_by_id)
|
||||
if not self.cancelled_by_id:
|
||||
return "an API call"
|
||||
return User.from_id(self.cancelled_by_id).name
|
||||
|
||||
@cached_property
|
||||
def count_of_phones(self):
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
</p>
|
||||
{% elif broadcast_message.status == 'cancelled' %}
|
||||
<p class="govuk-body">
|
||||
Stopped by {{ broadcast_message.cancelled_by.name }}
|
||||
Stopped by {{ broadcast_message.cancelled_by }}
|
||||
{{ broadcast_message.cancelled_at|format_datetime_human }}.
|
||||
</p>
|
||||
{% elif broadcast_message.status == 'completed' %}
|
||||
|
||||
Reference in New Issue
Block a user