From 83d720bb7be8865df4d0ef3cc859202cc33c38ba Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Mon, 12 Nov 2018 15:25:48 +0000 Subject: [PATCH] Change error message, the folder id is not useful infomation to the user. --- app/template_folder/rest.py | 4 +--- tests/app/template_folder/test_template_folder_rest.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/template_folder/rest.py b/app/template_folder/rest.py index 5097fd429..32eff0dd4 100644 --- a/app/template_folder/rest.py +++ b/app/template_folder/rest.py @@ -141,9 +141,7 @@ def move_to_template_folder(service_id, target_template_folder_id=None): def _validate_folder_move(target_template_folder, target_template_folder_id, template_folder, template_folder_id): if str(target_template_folder_id) == str(template_folder_id): - msg = 'Could not move to folder: {} to itself'.format( - template_folder_id - ) + msg = 'Could not move to folder to itself' raise InvalidRequest(msg, status_code=400) if target_template_folder and template_folder.is_parent_of(target_template_folder): msg = 'Could not move to folder: {} is an ancestor of target folder {}'.format( diff --git a/tests/app/template_folder/test_template_folder_rest.py b/tests/app/template_folder/test_template_folder_rest.py index 0d8d7346f..0e9da0c8b 100644 --- a/tests/app/template_folder/test_template_folder_rest.py +++ b/tests/app/template_folder/test_template_folder_rest.py @@ -343,7 +343,7 @@ def test_move_to_folder_itself_is_rejected(admin_request, sample_service): }, _expected_status=400 ) - response['message'] == 'Could not move to folder: {} to itself'.format(target_folder.id) + assert response['message'] == 'Could not move to folder to itself' def test_move_to_folder_skips_archived_templates(admin_request, sample_service):