Skip to content

Commit

Permalink
components: Pass components uow to service calls
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
rekt-hard authored and max-moser committed Oct 7, 2024
1 parent d0895df commit d5de837
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions invenio_curations/services/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ 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
)

def _check_update_request(
Expand Down Expand Up @@ -161,4 +161,6 @@ def update_draft(self, identity, data=None, record=None, errors=None):

# Request is closed but draft was updated with new data. Put back for review
if diff_list:
current_requests_service.execute_action(identity, request["id"], "resubmit")
current_requests_service.execute_action(
identity, request["id"], "resubmit", uow=self.uow
)

0 comments on commit d5de837

Please sign in to comment.