mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 08:31:00 -04:00
Add a page to view a single broadcast
This commit adds a page to view a single broadcast. This is important for two reasons: - users need an audit of what happened when, and who else was involved in approving or cancelling a broadcast - we need a place to put actions (approving, cancelling) on a broadcast so that you can confirm details of the message and the areas before performing the action
This commit is contained in:
@@ -5,6 +5,7 @@ from notifications_utils.template import BroadcastPreviewTemplate
|
||||
from orderedset import OrderedSet
|
||||
|
||||
from app.models import JSONModel, ModelList
|
||||
from app.models.user import User
|
||||
from app.notify_client.broadcast_message_api_client import (
|
||||
broadcast_message_api_client,
|
||||
)
|
||||
@@ -94,6 +95,18 @@ class BroadcastMessage(JSONModel):
|
||||
return 'completed'
|
||||
return self._dict['status']
|
||||
|
||||
@property
|
||||
def created_by(self):
|
||||
return User.from_id(self.created_by_id)
|
||||
|
||||
@property
|
||||
def approved_by(self):
|
||||
return User.from_id(self.approved_by_id)
|
||||
|
||||
@property
|
||||
def cancelled_by(self):
|
||||
return User.from_id(self.cancelled_by_id)
|
||||
|
||||
def add_areas(self, *new_areas):
|
||||
broadcast_message_api_client.update_broadcast_message(
|
||||
broadcast_message_id=self.id,
|
||||
|
||||
Reference in New Issue
Block a user