From 5b763d935afc35f8129db4242a9a8d08a2f282af Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 18 Apr 2017 13:15:48 +0100 Subject: [PATCH] Remove template type parameter on redirect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a hangover from when we had separate email/SMS template pages. If the view doesn’t use a parameter Flask adds it to the querystring. So we were getting URLs that ended in `?template_type=sms`, to no effect. --- app/main/views/templates.py | 1 - tests/app/main/views/test_templates.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 9a7056e51..419bf803b 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -347,7 +347,6 @@ def delete_service_template(service_id, template_id): return redirect(url_for( '.choose_template', service_id=service_id, - template_type=template['template_type'] )) try: diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index b321ca50a..6ac1fe551 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -580,7 +580,7 @@ def test_should_redirect_when_deleting_a_template( assert response.status_code == 302 assert response.location == url_for( '.choose_template', - service_id=service_id, template_type=type_, _external=True) + service_id=service_id, _external=True) mock_get_service_template.assert_called_with( service_id, template_id) mock_delete_service_template.assert_called_with(