mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Fix count of columns on breaking change page
For some reason we were rebuilding `new_template` as a dictionary, without the `placeholders` attribute. This meant that we were never actually counting the placeholders, just counting the length of `None` and adding 1 to it. So this commit fixes that, beefs up the tests, and makes sure that everything is pluralised properly.
This commit is contained in:
@@ -262,12 +262,7 @@ def edit_service_template(service_id, template_id):
|
||||
return render_template(
|
||||
'views/templates/breaking-change.html',
|
||||
template_change=template_change,
|
||||
new_template={
|
||||
'name': form.name.data,
|
||||
'subject': subject,
|
||||
'content': form.template_content.data,
|
||||
'id': new_template.id
|
||||
},
|
||||
new_template=new_template,
|
||||
column_headings=list(ascii_uppercase[:len(new_template.placeholders) + 1]),
|
||||
example_rows=[
|
||||
first_column_headings[new_template.template_type] + list(new_template.placeholders),
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
|
||||
<p>
|
||||
When you send messages using this template you’ll need
|
||||
{{ new_template.placeholders|length + 1 }} columns of data:
|
||||
{{ new_template.placeholders|length + 1 }}
|
||||
column{{ 's' if new_template.placeholders|length > 0 else '' }} of data:
|
||||
</p>
|
||||
|
||||
<div class="spreadsheet">
|
||||
|
||||
Reference in New Issue
Block a user