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.
This commit is contained in:
Pea Tyczynska
2021-01-29 15:20:29 +00:00
parent 86ea89cf76
commit 552e543bc2

View File

@@ -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