mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
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:
@@ -1,6 +1,7 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import iso8601
|
import iso8601
|
||||||
|
|
||||||
from flask import Blueprint, jsonify, request, current_app
|
from flask import Blueprint, jsonify, request, current_app
|
||||||
from app.config import QueueNames
|
from app.config import QueueNames
|
||||||
from app.dao.dao_utils import dao_save_object
|
from app.dao.dao_utils import dao_save_object
|
||||||
@@ -215,7 +216,7 @@ def _create_broadcast_event(broadcast_message):
|
|||||||
|
|
||||||
dao_save_object(event)
|
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(
|
send_broadcast_event.apply_async(
|
||||||
kwargs={'broadcast_event_id': str(event.id)},
|
kwargs={'broadcast_event_id': str(event.id)},
|
||||||
queue=QueueNames.BROADCASTS
|
queue=QueueNames.BROADCASTS
|
||||||
|
|||||||
Reference in New Issue
Block a user