From 42b3f13538547b721c1b87d0bc5594495880e8fc Mon Sep 17 00:00:00 2001 From: David McDonald Date: Tue, 6 Apr 2021 14:21:57 +0100 Subject: [PATCH] Don't send real broadcasts for preview training mode We previously allowed MNOs to approve a broadcast themselves in training mode and have it go out to their integration environment as per https://github.com/alphagov/notifications-api/pull/3114 However, we want to remove this use case as it means we have to support configuration for training mode services to do things like pick a channel and send out alerts which we definteily don't want to do in production. By making this change, we reduce the chance of a single bug meaning an alert will go out in prod that shouldn't. Note, will also make it harder for development environment testing but I think it is still worth it as https://www.pivotaltracker.com/story/show/177584959 will make it much harder in our code to allow some environments to send alerts whilst in training mode. --- app/broadcast_message/rest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/broadcast_message/rest.py b/app/broadcast_message/rest.py index 9d8dffaa5..859f2636d 100644 --- a/app/broadcast_message/rest.py +++ b/app/broadcast_message/rest.py @@ -214,7 +214,7 @@ def _create_broadcast_event(broadcast_message): dao_save_object(event) - if not broadcast_message.stubbed or current_app.config['NOTIFY_ENVIRONMENT'] in ['preview', 'development']: + if not broadcast_message.stubbed: send_broadcast_event.apply_async( kwargs={'broadcast_event_id': str(event.id)}, queue=QueueNames.BROADCASTS