Move ‘send test’ link back to template page

This changes it back to how it was when we first introduced this
feature:
https://github.com/alphagov/notifications-admin/pull/181

It’s kind of lost on the page where you upload a file, which is a shame
because it’s a good teaching aid.
This commit is contained in:
Chris Hill-Scott
2016-07-01 07:04:55 +01:00
parent facfb98bb3
commit 46f8dd3c79
4 changed files with 15 additions and 9 deletions

View File

@@ -242,11 +242,16 @@ def check_messages(service_id, template_type, upload_id):
) if current_service['restricted'] else None
)
if request.args.get('from_test') and len(template.placeholders):
if request.args.get('from_test'):
extra_args = {'help': 1} if request.args.get('help', '0') != '0' else {}
back_link = url_for(
'.send_test', service_id=service_id, template_id=template.id, **extra_args
)
if len(template.placeholders):
back_link = url_for(
'.send_test', service_id=service_id, template_id=template.id, **extra_args
)
else:
back_link = url_for(
'.choose_template', service_id=service_id, template_type=template.template_type, **extra_args
)
else:
back_link = url_for('.send_messages', service_id=service_id, template_id=template.id)