Skip to content

Commit

Permalink
fix(wip): Working on migration problems
Browse files Browse the repository at this point in the history
  • Loading branch information
monotasker committed Oct 30, 2024
1 parent 06428e7 commit f8d545b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions invenio_record_importer_kcworks/services/communities.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,22 +554,21 @@ def add_record_to_group_collections(
# if c["custom_fields"].get("kcr:commons_group_name")
# == group_name
# ]
app.logger.debug(
f"coll_record: {pformat(coll_search.to_dict())}"
)
app.logger.debug(f"coll_record: {pformat(coll_search)}")
try:
assert len(coll_records) == 1
except AssertionError:
app.logger.debug(pformat(metadata_record))
if (
len(coll_records) > 1
and metadata_record["is_published"] is False
and metadata_record["status"] != "published"
):
if len(coll_records) > 1:
raise MultipleActiveCollectionsError(
f" multiple active collections found "
f"for {group_id}"
)
else:
raise CollectionNotFoundError(
f" no active collections found for "
f'"{group_id}"'
)
coll_record = coll_records[0]
app.logger.debug(
f" found group collection {coll_record['id']}"
Expand Down

0 comments on commit f8d545b

Please sign in to comment.