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:
Pea Tyczynska
2022-01-18 12:23:20 +00:00
parent f9fe0a460d
commit 78681eb452
3 changed files with 13 additions and 2 deletions

View File

@@ -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):