Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update request title #34

Merged
merged 3 commits into from
Oct 7, 2024
Merged

Update request title #34

merged 3 commits into from
Oct 7, 2024

Conversation

rekt-hard
Copy link
Contributor

Update the curation request title, whenever the title of the draft changes (closes #27)

When a draft is deleted, a curation review is fetched. Since we would completely serialize this review and generate links, we would also try to resolve the topic of the review - which is a draft. However, when deleting a draft, it will be set to deleted before running the components. This will lead to a PIDDoesNotExistError in the generator. Such an exception will now be caught and an empty set will be returned instead of trying to read the permissions of the entity.

Pass uow to service calls. For some reason, we could end up in a state where a request's status is "resubmitted" in the database while it is accepted in opensearch. This lead to the request being displayed correctly on the request detail page (request read from database) but incorrectly on the record deposit page (request read from opensearch). Since when running the component, it is also read from opensearch, this would lead to the issue of trying to execute the request resubmit action on draft changes, even though it was already in resubmitted state.

* For some reason, we could end up in a state where
  a request's status is "resubmitted" in the database
  while it is `accepted` in opensearch.
Copy link
Collaborator

@max-moser max-moser left a comment

Choose a reason for hiding this comment

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

thanks!

@@ -68,9 +68,25 @@ def delete_draft(self, identity, draft=None, record=None, force=False):
# Delete draft for a published record.
# Since only one request per record should exist, it is not deleted. Instead, put it back to accepted.
current_requests_service.execute_action(
system_identity, request["id"], "cancel"
system_identity, request["id"], "cancel", uow=self.uow
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh, good catch 🎣

@max-moser max-moser merged commit d5de837 into main Oct 7, 2024
2 checks passed
@max-moser max-moser deleted the update-request-title branch October 7, 2024 18:26
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.

Update the request title with record title
2 participants