mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 00:11:16 -05:00
Merge pull request #3214 from alphagov/check-broadcast-suspended
Enforce service suspension for broadcasts
This commit is contained in:
@@ -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'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user