mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-01 04:09:46 -04:00
Fix order of steps in send/send test journeys
This fixes the bug where if you have three placeholders: > ((one)) ((two)) ((three)) The first one you are asked to fill in is `((three))` (ie `template.placeholders[-1]`). This reintroduces a bug where if you use the ‘Use my phone number’ link you skip straight to filling in `((two))` and can never proceed because you’re never given the chance to fill in `((one))`. This commit also fixes that bug.
This commit is contained in:
@@ -386,10 +386,7 @@ def send_test_step(service_id, template_id, step_index):
|
||||
)
|
||||
|
||||
try:
|
||||
if request.endpoint == 'main.send_test_step':
|
||||
current_placeholder = placeholders[step_index - 1]
|
||||
else:
|
||||
current_placeholder = placeholders[step_index]
|
||||
current_placeholder = placeholders[step_index]
|
||||
except IndexError:
|
||||
if all_placeholders_in_session(placeholders):
|
||||
return get_notification_check_endpoint(service_id, template)
|
||||
@@ -449,7 +446,7 @@ def send_test_step(service_id, template_id, step_index):
|
||||
):
|
||||
skip_link = (
|
||||
'Use my {}'.format(first_column_headings[template.template_type][0]),
|
||||
url_for('.send_test_step', service_id=service_id, template_id=template.id, step_index=1),
|
||||
url_for('.send_test', service_id=service_id, template_id=template.id),
|
||||
)
|
||||
else:
|
||||
skip_link = None
|
||||
|
||||
Reference in New Issue
Block a user