Fix back link on ‘sent’ page in tour

If the user wants to go back from here they need to be sent back to the
start of entering the placeholders, because we won’t have their previous
personalisation in the session still

I think the back link on this page was introduced by accident. But it’s
good to still have it on this page, because it keeps consistency with
the previous pages.
This commit is contained in:
Chris Hill-Scott
2019-06-06 11:16:22 +01:00
parent 62fb71966b
commit 48eb698713
2 changed files with 20 additions and 5 deletions

View File

@@ -101,8 +101,13 @@ def view_notification(service_id, notification_id):
show_cancel_button = notification['notification_type'] == 'letter' and \
letter_can_be_cancelled(notification['status'], notification_created)
if request.args.get('help') == '0':
back_link = None
if get_help_argument():
back_link = url_for(
'main.send_test',
service_id=current_service.id,
template_id=template.id,
help='2',
)
elif request.args.get('from_job'):
back_link = url_for(
'main.view_job',

View File

@@ -125,12 +125,22 @@ def test_notification_status_page_respects_redaction(
partial(url_for, 'main.view_job', job_id='job_id'),
),
(
{'help': '0'},
None,
{'help': '0'}, # not a valid help step
partial(url_for, 'main.view_notifications', message_type='sms', status='sending,delivered,failed'),
),
(
{'help': '0', 'from_job': 'job_id'},
None,
partial(url_for, 'main.view_job', job_id='job_id'),
),
(
{'help': '1'},
partial(
url_for,
'main.send_test',
service_id=SERVICE_ONE_ID,
template_id='5407f4db-51c7-4150-8758-35412d42186a',
help='2'
),
),
])
def test_notification_status_shows_expected_back_link(