Skip to content

Commit

Permalink
add drafts to legacy models
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed Jun 11, 2024
1 parent f2c8082 commit e930ac4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bioimageio_collection_backoffice/remote_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,9 +1073,19 @@ def maybe_swap_with_thumbnail(
) not in entry_versions:
entry_versions.insert(0, this_version_id)

versions_sha256: List[Optional[str]] = [None] * (len(entry_versions) - 1)
drafts = [v for v in versions if isinstance(v, RecordDraft)]
entry_versions = [v.id for v in drafts] + entry_versions
drafts_sha256 = [
None if d is None else hashlib.sha256(d).hexdigest()
for d in [v.client.load_file(v.rdf_path) for v in drafts]
]
versions_sha256: List[Optional[str]] = drafts_sha256 + (
[None] * len(entry_versions)
)

entry_dois = [f"10.5281/zenodo.{v}" for v in entry_versions]
entry_dois = ([None] * len(drafts)) + [
f"10.5281/zenodo.{v}" for v in entry_versions
]
else:
concept_doi = rv.concept_doi
entry_id = rdf["id"]
Expand Down

0 comments on commit e930ac4

Please sign in to comment.