mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Add a confirmation checkbox for live broadcasts
We want people to be really sure before sending a live broadcast, not just clicking through the green buttons. This commit adds a checkbox which explains exactly the consequences of what they’re about to do, tailored to the channel they’re on, and the area chosen by the person creating the alert.
This commit is contained in:
@@ -14,6 +14,7 @@ from app.main.forms import (
|
||||
BroadcastAreaForm,
|
||||
BroadcastAreaFormWithSelectAll,
|
||||
BroadcastTemplateForm,
|
||||
ConfirmBroadcastForm,
|
||||
NewBroadcastForm,
|
||||
SearchByNameForm,
|
||||
)
|
||||
@@ -401,6 +402,11 @@ def view_broadcast(service_id, broadcast_message_id):
|
||||
back_link_endpoint,
|
||||
service_id=current_service.id,
|
||||
),
|
||||
form=ConfirmBroadcastForm(
|
||||
service_is_live=current_service.live,
|
||||
channel=current_service.broadcast_channel,
|
||||
max_phones=broadcast_message.count_of_phones_likely,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -414,6 +420,12 @@ def approve_broadcast_message(service_id, broadcast_message_id):
|
||||
service_id=current_service.id,
|
||||
)
|
||||
|
||||
form = ConfirmBroadcastForm(
|
||||
service_is_live=current_service.live,
|
||||
channel=current_service.broadcast_channel,
|
||||
max_phones=broadcast_message.count_of_phones_likely,
|
||||
)
|
||||
|
||||
if broadcast_message.status != 'pending-approval':
|
||||
return redirect(url_for(
|
||||
'.view_current_broadcast',
|
||||
@@ -421,14 +433,15 @@ def approve_broadcast_message(service_id, broadcast_message_id):
|
||||
broadcast_message_id=broadcast_message.id,
|
||||
))
|
||||
|
||||
broadcast_message.approve_broadcast()
|
||||
|
||||
if current_service.trial_mode:
|
||||
broadcast_message.approve_broadcast()
|
||||
return redirect(url_for(
|
||||
'.broadcast_tour',
|
||||
service_id=current_service.id,
|
||||
step_index=6,
|
||||
))
|
||||
elif form.validate_on_submit():
|
||||
broadcast_message.approve_broadcast()
|
||||
|
||||
return redirect(url_for(
|
||||
'.view_current_broadcast',
|
||||
|
||||
Reference in New Issue
Block a user