diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 381117f9d..b6b1fb2c7 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -603,7 +603,12 @@ def edit_service_template(service_id, template_id): new_template = get_template(new_template_data, current_service) template_change = get_template(template, current_service).compare_to(new_template) - if template_change.placeholders_added and not request.form.get('confirm'): + + if ( + template_change.placeholders_added and + not request.form.get('confirm') and + current_service.api_keys + ): example_column_headings = ( first_column_headings[new_template.template_type] + list(new_template.placeholders) ) diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index 90f4cdfd0..9c6ac9968 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -1328,6 +1328,7 @@ def test_should_redirect_to_one_off_if_template_type_is_letter( def test_should_redirect_when_saving_a_template( client_request, mock_get_service_template, + mock_get_api_keys, mock_update_service_template, fake_uuid, ): @@ -1499,6 +1500,7 @@ def test_should_show_interstitial_when_making_breaking_change( client_request, mock_update_service_template, mock_get_user_by_email, + mock_get_api_keys, fake_uuid, mocker, template_mock,