diff --git a/src/routes/entity_CRUD/__init__.py b/src/routes/entity_CRUD/__init__.py index c562dde5..6ef512bc 100644 --- a/src/routes/entity_CRUD/__init__.py +++ b/src/routes/entity_CRUD/__init__.py @@ -1,5 +1,3 @@ -from pathlib import Path - from flask import Blueprint, jsonify, request, Response, current_app, abort, json import logging import requests @@ -105,11 +103,11 @@ def multiple_components(): for dataset in json_data_dict.get('datasets'): if 'dataset_link_abs_dir' in dataset: if not os.path.exists(dataset['dataset_link_abs_dir']): - return Response(f"The filepath specified with 'dataset_link_abs_dir' does not exist: {dataset['dataset_link_abs_dir']}", 500) + return Response(f"The filepath specified with 'dataset_link_abs_dir' does not exist: {dataset['dataset_link_abs_dir']}", 400) if not os.path.isdir(dataset['dataset_link_abs_dir']): - return Response(f"The filepath specified with 'dataset_link_abs_dir is not a directory: {dataset['dataset_link_abs_dir']}", 500) + return Response(f"The filepath specified with 'dataset_link_abs_dir is not a directory: {dataset['dataset_link_abs_dir']}", 400) else: - return Response("Required field 'dataset_link_abs_dir' is missing from dataset", 500) + return Response("Required field 'dataset_link_abs_dir' is missing from dataset", 400) requested_group_uuid = None if 'group_uuid' in component_request: @@ -133,7 +131,7 @@ def multiple_components(): f"Creating a directory as: {new_directory_path} with a symbolic link to: {dataset['dataset_link_abs_dir']}") os.symlink(dataset['dataset_link_abs_dir'], new_directory_path) else: - return Response("Required field 'dataset_link_abs_dir' is missing from dataset", 500) + return Response("Required field 'dataset_link_abs_dir' is missing from dataset", 400) return jsonify(new_datasets_list) except HTTPException as hte: