Skip to content

Commit

Permalink
Mapped the new categorical value of 'process_state' to the legacy 'pr…
Browse files Browse the repository at this point in the history
…imary' field in the legacy assayname and assaytypes endpoints.
  • Loading branch information
AlanSimmons committed Jul 29, 2024
1 parent c420525 commit 58be6c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hs_ontology_api/routes/assaytype/assaytype_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def assaytype_get(name=None):
# Validate parameters.

# Check for invalid parameter names.
err = validate_query_parameter_names(parameter_name_list=['application_context', 'is_primary'])
err = validate_query_parameter_names(parameter_name_list=['application_context', 'primary'])
if err != 'ok':
return make_response(err, 400)

Expand All @@ -49,11 +49,11 @@ def assaytype_get(name=None):

# Check for valid parameter values.
# Map the legacy is_primary parameter to new process_state parameter.
is_primary = request.args.get('is_primary')
is_primary = request.args.get('primary')
if is_primary is not None:
is_primary = is_primary.lower()
val_enum = ['true', 'false']
err = validate_parameter_value_in_enum(param_name='is_primary', param_value=is_primary, enum_list=val_enum)
err = validate_parameter_value_in_enum(param_name='primary', param_value=is_primary, enum_list=val_enum)
if err != 'ok':
return make_response(err, 400)
if is_primary == 'true':
Expand Down

0 comments on commit 58be6c1

Please sign in to comment.