mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Don’t let users self-approve broadcasts
At the moment they will get a ‘technical difficulties’ error if they try. We probably want to do something around letting people self-approve broadcasts in trial mode, but for now just telling them they can’t is a better experience than ‘technical difficulties’ (and will probably be close to what they should see on a live service as well).
This commit is contained in:
@@ -3,6 +3,7 @@ from datetime import datetime
|
||||
from notifications_utils.broadcast_areas import broadcast_area_libraries
|
||||
from notifications_utils.template import BroadcastPreviewTemplate
|
||||
from orderedset import OrderedSet
|
||||
from werkzeug.utils import cached_property
|
||||
|
||||
from app.models import JSONModel, ModelList
|
||||
from app.models.user import User
|
||||
@@ -94,15 +95,15 @@ class BroadcastMessage(JSONModel):
|
||||
return 'completed'
|
||||
return self._dict['status']
|
||||
|
||||
@property
|
||||
@cached_property
|
||||
def created_by(self):
|
||||
return User.from_id(self.created_by_id)
|
||||
|
||||
@property
|
||||
@cached_property
|
||||
def approved_by(self):
|
||||
return User.from_id(self.approved_by_id)
|
||||
|
||||
@property
|
||||
@cached_property
|
||||
def cancelled_by(self):
|
||||
return User.from_id(self.cancelled_by_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user