Skip to content

fix(ep): fix approval request load and apprn handling - #597

Open
zubeydecivelek wants to merge 1 commit into
CERNDocumentServer:masterfrom
zubeydecivelek:fix-ep-load
Open

fix(ep): fix approval request load and apprn handling#597
zubeydecivelek wants to merge 1 commit into
CERNDocumentServer:masterfrom
zubeydecivelek:fix-ep-load

Conversation

@zubeydecivelek

Copy link
Copy Markdown
Contributor

No description provided.

Comment on lines +191 to 193
# Consume the key even if the value is later dropped.
dojson_entry.pop(mapper.id, None)
return {k: v for k, v in metadata.items() if v}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's empty field we're having Unassigned metadata key error.

  • {k: v if v} drops it from record.body["metadata"]
  • Key still sits in dojson_entry
  • Check thinks it’s unassigned

Comment on lines +323 to +329
scheme = id_entry.get("scheme")
identifier = id_entry.get("identifier", "")
# apprn belongs only on the public record.
if scheme == "apprn":
removed.append(identifier)
continue
elif scheme != "cdsrn":

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed apprn from restricted record

Comment on lines +152 to +160
# Parent access grants + communities before EP approval request
# (needs parent.communities.default for referee group lookup).
self.parent_load_cls(
restricted_entry, self.migration_logger, restricted_record_state
).load(published_record=restricted_records[-1], uow=uow)

# 2. Create and approve EP approval request
approval_request_load.create(restricted_record_state, uow=uow)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApprovalRequestLoad needs parent.communities.default to pick the EP referee group. So it should be set before creating the request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant