Merge pull request #3137 from alphagov/revert-revert-revert

Bring back retry logic
This commit is contained in:
Leo Hemsted
2021-02-15 12:21:13 +00:00
committed by GitHub
9 changed files with 492 additions and 69 deletions

View File

@@ -56,7 +56,7 @@ def _update_broadcast_message(broadcast_message, new_status, updating_user):
f'User {updating_user.id} cannot approve their own broadcast_message {broadcast_message.id}',
status_code=400
)
elif not broadcast_message.areas:
elif len(broadcast_message.areas['simple_polygons']) == 0:
raise InvalidRequest(
f'broadcast_message {broadcast_message.id} has no selected areas and so cannot be broadcasted.',
status_code=400
@@ -209,7 +209,7 @@ def _create_broadcast_event(broadcast_message):
dao_save_object(event)
if not broadcast_message.stubbed or current_app.config['NOTIFY_ENVIRONMENT'] == 'preview':
if not broadcast_message.stubbed or current_app.config['NOTIFY_ENVIRONMENT'] in ['preview', 'development']:
send_broadcast_event.apply_async(
kwargs={'broadcast_event_id': str(event.id)},
queue=QueueNames.BROADCASTS