From a8c62ee40a53814ccd9383a741d8a792815acfae Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 4 May 2016 17:34:48 +0100 Subject: [PATCH] =?UTF-8?q?Make=20=E2=80=98Back=E2=80=99=20button=20go=20t?= =?UTF-8?q?o=20the=20right=20place?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When you send yourself a test clicking the grey ‘Back’ button should send you back to the page with the textboxes, if that’s where you came from. --- app/main/views/send.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/main/views/send.py b/app/main/views/send.py index d9a81a02c..20edf513b 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -51,8 +51,6 @@ def get_page_headings(template_type): def get_example_csv_fields(column_headers, use_example_as_example, submitted_fields): - print("="*40) - print(list(column_headers)) if use_example_as_example: return ["example" for header in column_headers] elif submitted_fields: @@ -137,7 +135,7 @@ def send_messages(service_id, template_id): 'views/send.html', template=template, recipient_column=first_column_heading[template.template_type], - example=[get_example_csv_rows(template, use_example_as_example=True)], + example=[get_example_csv_rows(template)], form=form ) @@ -253,7 +251,7 @@ def check_messages(service_id, template_type, upload_id): ) if current_service['restricted'] else None ) - if request.args.get('from_test'): + if request.args.get('from_test') and len(template.placeholders): back_link = url_for('.send_test', service_id=service_id, template_id=template.id) else: back_link = url_for('.send_messages', service_id=service_id, template_id=template.id)