Make removing placeholders a non-breaking change

The CSV upload route has always quietly ignored excess personalisation.
We changed the API to do the same here:
https://github.com/alphagov/notifications-api/pull/853

This means that removing a placeholder from a template is never a
breaking change, because the data that you were providing to populate it
is now just ignored.

So we don’t need to show the interstitial page in this case.
This commit is contained in:
Chris Hill-Scott
2017-05-17 13:05:18 +01:00
parent 78093f82d9
commit 42ebc44b83
2 changed files with 33 additions and 1 deletions

View File

@@ -259,7 +259,7 @@ def edit_service_template(service_id, template_id):
'process_type': form.process_type.data
}, 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'):
if template_change.placeholders_added and not request.form.get('confirm'):
example_column_headings = (
first_column_headings[new_template.template_type] +
list(new_template.placeholders)