Skip to content

Commit

Permalink
Tolerate docdb entries with no Code Ocean links
Browse files Browse the repository at this point in the history
  • Loading branch information
bjhardcastle committed Dec 11, 2024
1 parent 1ddcad2 commit 06700d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aind_session/utils/docdb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def extract_codeocean_data_asset_ids_from_docdb_record(
asset_ids: list[str] = []
links = record["external_links"]
if isinstance(links, dict): # {"Code Ocean": [asset_id, ...]} (post-Sep '24)
ids = links["Code Ocean"]
ids = links.get("Code Ocean", [])
elif isinstance(links, list): # [{"Code Ocean": asset_id}, ...] (pre-Sep '24)
ids = [link["Code Ocean"] for link in links if "Code Ocean" in link]
else:
Expand Down

0 comments on commit 06700d1

Please sign in to comment.