Bug fixed when sending yourself a test the back button links to the correct url.

Remove traceback.
This commit is contained in:
Nicholas Staples
2016-06-06 16:38:55 +01:00
parent 3ddc1d171d
commit d53b4bd7cd
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)