Skip to content

Commit bb092d7

Browse files
committed
Switch to use of bad_request_error() and mention case-insensitivity in error message per code review.
1 parent 427c1f2 commit bb092d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ def create_entity(entity_type):
11211121
try:
11221122
supress_reindex = _suppress_reindex()
11231123
except Exception as e:
1124-
return http_bad_request(e)
1124+
bad_request_error(e)
11251125

11261126
# Additional validation for Sample entities
11271127
if normalized_entity_type == 'Sample':
@@ -1430,7 +1430,7 @@ def update_entity(id):
14301430
try:
14311431
suppress_reindex = _suppress_reindex()
14321432
except Exception as e:
1433-
return http_bad_request(e)
1433+
bad_request_error(e)
14341434

14351435
# Proceed with per-entity updates after passing any entity-level or property-level validations which
14361436
# would have locked out updates.
@@ -4084,7 +4084,7 @@ def multiple_components():
40844084
try:
40854085
suppress_reindex = _suppress_reindex()
40864086
except Exception as e:
4087-
return http_bad_request(e)
4087+
bad_request_error(e)
40884088

40894089
dataset_list = create_multiple_component_details(request, "Dataset", user_token, json_data_dict.get('datasets'), json_data_dict.get('creation_action'))
40904090

@@ -4604,7 +4604,7 @@ def _suppress_reindex() -> bool:
46044604
return True
46054605
elif reindex_str == 'true':
46064606
return False
4607-
raise Exception(f"The value of the 'reindex' parameter must be True or False."
4607+
raise Exception(f"The value of the 'reindex' parameter must be True or False (case-insensitive)."
46084608
f" '{request.args.get('reindex')}' is not recognized.")
46094609

46104610
"""

0 commit comments

Comments
 (0)