From c43fde0ac023712427814c79304f5f6fd4bc07bb Mon Sep 17 00:00:00 2001 From: Martyn Inglis Date: Mon, 22 Aug 2016 16:35:14 +0100 Subject: [PATCH] For the brief moment when we have incompatible API versions out, We won't call template stats by template id as the format has changed. So just ask the question "do you want to delete" without the context. --- app/main/views/templates.py | 4 +--- tests/app/main/views/test_templates.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 6711e29fd..17183f671 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -186,9 +186,7 @@ def delete_service_template(service_id, template_id): template['template_content'] = template['content'] form = form_objects[template['template_type']](**template) - template_statistics = template_statistics_client.get_template_statistics_for_template(service_id, template['id']) - last_use_message = get_last_use_message(form.name.data, template_statistics) - flash('{}. Are you sure you want to delete it?'.format(last_use_message), 'delete') + flash('Are you sure you want to delete it?', 'delete') return render_template( 'views/edit-{}-template.html'.format(template['template_type']), h1='Edit template', diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index 009b7f08f..8f296c653 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -249,7 +249,6 @@ def test_should_show_delete_template_page(app_, assert 'Two week reminder' in content assert 'Your vehicle tax is about to expire' in content mock_get_service_template.assert_called_with(service_id, template_id) - mock_get_template_statistics_for_template.assert_called_with(service_id, template_id) def test_should_redirect_when_deleting_a_template(app_,