Merge branch 'master' into refactor-s3-upload

Conflicts:
	requirements.txt
This commit is contained in:
Rebecca Law
2017-04-10 11:44:56 +01:00
13 changed files with 128 additions and 91 deletions

View File

@@ -77,7 +77,6 @@ def get_example_letter_address(key):
return {
'address line 1': 'A. Name',
'address line 2': '123 Example Street',
'address line 3': 'Example town',
'postcode': 'XM4 5HQ'
}.get(key, '')
@@ -237,13 +236,13 @@ def _check_messages(service_id, template_type, upload_id, letters_as_pdf=False):
if request.args.get('from_test'):
extra_args = {'help': 1} if request.args.get('help', '0') != '0' else {}
if len(template.placeholders):
if len(template.placeholders) or template.template_type == 'letter':
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, **extra_args
'.view_template', service_id=service_id, template_id=template.id, **extra_args
)
choose_time_form = None
else:

View File

@@ -287,13 +287,17 @@ def edit_service_template(service_id, template_id):
}, current_service)
template_change = get_template(template, current_service).compare_to(new_template)
if template_change.has_different_placeholders and not request.form.get('confirm'):
example_column_headings = (
first_column_headings[new_template.template_type] +
list(new_template.placeholders)
)
return render_template(
'views/templates/breaking-change.html',
template_change=template_change,
new_template=new_template,
column_headings=list(ascii_uppercase[:len(new_template.placeholders) + 1]),
column_headings=list(ascii_uppercase[:len(example_column_headings)]),
example_rows=[
first_column_headings[new_template.template_type] + list(new_template.placeholders),
example_column_headings,
get_example_csv_rows(new_template),
get_example_csv_rows(new_template)
],