Merge pull request #3214 from alphagov/check-broadcast-suspended

Enforce service suspension for broadcasts
This commit is contained in:
Ben Thorner
2021-04-28 15:01:11 +01:00
committed by GitHub
5 changed files with 113 additions and 50 deletions

View File

@@ -192,6 +192,9 @@ def update_broadcast_message_status(service_id, broadcast_message_id):
validate(data, update_broadcast_message_status_schema)
broadcast_message = dao_get_broadcast_message_by_id_and_service_id(broadcast_message_id, service_id)
if not broadcast_message.service.active:
raise InvalidRequest("Updating broadcast message is not allowed: service is inactive ", 403)
new_status = data['status']
updating_user = get_user_by_id(data['created_by'])