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:
Chris Hill-Scott
2020-08-05 16:01:21 +01:00
parent 8b44919551
commit 479406c02d
4 changed files with 86 additions and 14 deletions

View File

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