new chillmaid approved error messages

these get shown on the front-end so make sure their content is good
This commit is contained in:
Leo Hemsted
2018-12-10 12:59:16 +00:00
parent ad3b0cabf7
commit 474acc5bba
2 changed files with 4 additions and 9 deletions

View File

@@ -141,11 +141,8 @@ 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 folder to itself'
msg = 'You cannot move a 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(
template_folder_id,
target_template_folder_id
)
msg = 'You cannot move a folder to one of its subfolders'
raise InvalidRequest(msg, status_code=400)