mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 18:37:33 -04:00
Fix error case where the tour start page is skipped
This was causing us to key error for 'placeholders' being missing in the session dictionary. This fixes it and sends you back to the start
This commit is contained in:
@@ -49,6 +49,11 @@ def tour_step(service_id, template_id, step_index):
|
||||
if db_template['template_type'] != 'sms':
|
||||
abort(404)
|
||||
|
||||
if 'placeholders' not in session:
|
||||
return redirect(url_for(
|
||||
'.begin_tour', service_id=current_service.id, template_id=template_id
|
||||
))
|
||||
|
||||
template = get_template(
|
||||
db_template,
|
||||
current_service,
|
||||
@@ -119,6 +124,11 @@ def check_tour_notification(service_id, template_id):
|
||||
show_recipient=True,
|
||||
)
|
||||
|
||||
if 'placeholders' not in session:
|
||||
return redirect(url_for(
|
||||
'.begin_tour', service_id=current_service.id, template_id=template_id
|
||||
))
|
||||
|
||||
placeholders = fields_to_fill_in(template, prefill_current_user=True)
|
||||
|
||||
if not all_placeholders_in_session(template.placeholders):
|
||||
|
||||
Reference in New Issue
Block a user