diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 180c4fc5e..892f570d6 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -436,7 +436,7 @@ def delete_service_template(service_id, template_id): ) except HTTPError as e: if e.status_code == 404: - message = 'It’s never been used.'.format(template['name']) + message = None else: raise e diff --git a/app/templates/views/templates/template.html b/app/templates/views/templates/template.html index 95ea73c83..66142db28 100644 --- a/app/templates/views/templates/template.html +++ b/app/templates/views/templates/template.html @@ -30,9 +30,11 @@ {% elif template_delete_confirmation_message %}
{% call banner_wrapper(type='dangerous', subhead=template_delete_confirmation_message[0]) %} -

- {{ template_delete_confirmation_message[1] }} -

+ {% if template_delete_confirmation_message[1] %} +

+ {{ template_delete_confirmation_message[1] }} +

+ {% endif %}
diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index 5c8fe8b44..e2cb7aaa3 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -725,9 +725,7 @@ def test_should_show_delete_template_page_with_never_used_block( _test_page_title=False, ) assert page.h1.text == 'Are you sure you want to delete Two week reminder?' - assert normalize_spaces(page.select('.banner-dangerous p')[0].text) == ( - 'It’s never been used.' - ) + assert not page.select('.banner-dangerous p') assert normalize_spaces(page.select('.sms-message-wrapper')[0].text) == ( 'service one: Template content with & entity' )