Don’t let broadcast re-enable other channels

When a service is switched over to broadcast it has the email, text
message and letter permissions removed. And the links to switch these
settings back on are hidden.

This commit ensures that even if the user manually goes to the URLs for
these pages, they still won’t be able to switch the other channels back
on.
This commit is contained in:
Chris Hill-Scott
2020-07-13 09:04:53 +01:00
parent c17db333d3
commit 89dd64cbad
3 changed files with 30 additions and 0 deletions

View File

@@ -696,6 +696,9 @@ def service_set_channel(service_id, channel):
if channel not in {'email', 'sms', 'letter'}:
abort(404)
if current_service.has_permission('broadcast'):
abort(403)
form = ServiceSwitchChannelForm(
channel=channel,
enabled=current_service.has_permission(channel)