mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Fix order of placeholders in the tour
Doing a lookup with `step_index - 1` means that on step `0` we were looking up `placeholders[-1]`, ie we were making people fill in the last placeholder first. Fixing this reintroduces the bug fixed by this pull request: https://github.com/alphagov/notifications-admin/pull/2551 So this commit also re-fixes that bug but in a different way.
This commit is contained in:
@@ -386,11 +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)
|
||||
@@ -812,7 +808,7 @@ def get_back_link(service_id, template, step_index):
|
||||
service_id=service_id,
|
||||
template_id=template.id,
|
||||
)
|
||||
elif is_current_user_the_recipient() and step_index > 1:
|
||||
elif is_current_user_the_recipient() and step_index >= 1:
|
||||
return url_for(
|
||||
'main.send_test_step',
|
||||
service_id=service_id,
|
||||
|
||||
Reference in New Issue
Block a user