From 552e543bc2ad15185e6c9b1117a5e8a3ea32317a Mon Sep 17 00:00:00 2001 From: Pea Tyczynska Date: Fri, 29 Jan 2021 15:20:29 +0000 Subject: [PATCH] Don't stub broadcasts on preview So that MNOs can use training mode accounts to test end-to-end broadcast sending. This will enable them to approve their own broadcasts. --- app/broadcast_message/rest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/broadcast_message/rest.py b/app/broadcast_message/rest.py index 48f0a6e0f..b79cba07e 100644 --- a/app/broadcast_message/rest.py +++ b/app/broadcast_message/rest.py @@ -1,6 +1,7 @@ from datetime import datetime import iso8601 + from flask import Blueprint, jsonify, request, current_app from app.config import QueueNames from app.dao.dao_utils import dao_save_object @@ -215,7 +216,7 @@ def _create_broadcast_event(broadcast_message): dao_save_object(event) - if not broadcast_message.stubbed: + if not broadcast_message.stubbed or current_app.config['NOTIFY_ENVIRONMENT'] == 'preview': send_broadcast_event.apply_async( kwargs={'broadcast_event_id': str(event.id)}, queue=QueueNames.BROADCASTS