Skip to content

Commit

Permalink
Merge pull request #12 from kids-first/bug/handle_no_hidden_specimens
Browse files Browse the repository at this point in the history
🐛 Don't look for descendants of nothing
  • Loading branch information
fiendish authored Mar 15, 2021
2 parents b0a4731 + 7977d2b commit 65284bf
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions kf_update_dbgap_consent/sample_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,19 @@ def entities_dict(endpoint, filt):
Rule: If a biospecimen is hidden in the dataservice, its descendants
should also be hidden.
"""
descendants_of_hidden_specimens = find_descendants_by_kfids(
self.db_url or self.api_url,
"biospecimens",
list(hidden_specimens.keys()),
ignore_gfs_with_hidden_external_contribs=False,
kfids_only=False,
)
descendants_of_hidden_specimens["biospecimens"] = hidden_specimens
for endpoint, entities in descendants_of_hidden_specimens.items():
for k, e in entities.items():
storage[endpoint][k] = e
patches[endpoint][k]["visible"] = False
if hidden_specimens:
descendants_of_hidden_specimens = find_descendants_by_kfids(
self.db_url or self.api_url,
"biospecimens",
list(hidden_specimens.keys()),
ignore_gfs_with_hidden_external_contribs=False,
kfids_only=False,
)
descendants_of_hidden_specimens["biospecimens"] = hidden_specimens
for endpoint, entities in descendants_of_hidden_specimens.items():
for k, e in entities.items():
storage[endpoint][k] = e
patches[endpoint][k]["visible"] = False

print()

Expand Down

0 comments on commit 65284bf

Please sign in to comment.