Merge pull request #656 from alphagov/bug_fix_for_tour_back_button

Bug fixed when sending yourself a test the back button links to the c…
This commit is contained in:
NIcholas Staples
2016-06-07 15:17:40 +01:00
3 changed files with 79 additions and 2 deletions

View File

@@ -205,7 +205,6 @@ def send_from_api(service_id, template_id):
@login_required
@user_has_permissions('send_texts', 'send_emails', 'send_letters')
def check_messages(service_id, template_type, upload_id):
if not session.get('upload_data'):
return redirect(url_for('main.choose_template', service_id=service_id, template_type=template_type))
@@ -239,8 +238,9 @@ def check_messages(service_id, template_type, upload_id):
)
if request.args.get('from_test') and len(template.placeholders):
extra_args = {'help': 1} if request.args.get('help') else {}
back_link = url_for(
'.send_test', service_id=service_id, template_id=template.id, help=1 if request.args.get('help') else 0
'.send_test', service_id=service_id, template_id=template.id, **extra_args
)
else:
back_link = url_for('.send_messages', service_id=service_id, template_id=template.id)