Skip to content

Commit

Permalink
Creating new configuration parameter to generalize ID naming in methods
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsibilla committed Sep 9, 2024
1 parent f7b1be5 commit 53c5314
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ def build_manifest(self, request, response):
for hit in hit_list:
source = hit.get("_source")
entity_type = source.get("entity_type")
hubmap_id = source.get("hubmap_id")
consortium_id = source.get(self.CONSORTIUM_ID)
if entity_type is None:
return make_response(jsonify("Required field 'entity_type' was not returned by the query. Make sure it has not been excluded"), 400)
if entity_type.lower() == "dataset":
manifest_list.append(f"{hubmap_id} /")
manifest_list.append(f"{consortium_id} /")
if not manifest_list:
return make_response(jsonify("Query returned successfully but contained no datasets."), 204)
manifest_text = '\n'.join(manifest_list)
Expand Down Expand Up @@ -511,11 +511,11 @@ def param_search_index(self, plural_entity_type):
for hit in hit_list:
source = hit.get("_source")
entity_type = source.get("entity_type")
hubmap_id = source.get("hubmap_id")
consortium_id = source.get(self.CONSORTIUM_ID)
if entity_type is None:
return make_response(jsonify("Required field 'entity_type' was not returned by the query. Make sure it has not been excluded"), 400)
if entity_type.lower() == "dataset":
manifest_list.append(f"{hubmap_id} /")
manifest_list.append(f"{consortium_id} /")
if not manifest_list:
return make_response(jsonify("Query returned successfully but contained no datasets."), 204)
manifest_text = '\n'.join(manifest_list)
Expand Down

0 comments on commit 53c5314

Please sign in to comment.