Skip to content

Commit

Permalink
review: fix draft indexing operations order
Browse files Browse the repository at this point in the history
* Fixes a bug where when publishing directly to a community (e.g.
  beacause the uplader is a community admin/owner/curator), the draft
  would get deleted form the index and then indexed again, thus
  appearing twice in the users' dashboard both as a published record and
  as a draft in review.
* Closes #1730.
  • Loading branch information
slint committed Apr 22, 2024
1 parent a2eba5d commit 89ea407
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion invenio_rdm_records/services/review/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def submit(self, identity, id_, data=None, require_review=False, uow=None):
# request object
draft.parent.review = request
uow.register(ParentRecordCommitOp(draft.parent))
uow.register(RecordIndexOp(draft, indexer=self.indexer))

if not require_review:
request_item = current_rdm_records.community_inclusion_service.include(
Expand All @@ -196,5 +197,4 @@ def submit(self, identity, id_, data=None, require_review=False, uow=None):
)
)
)
uow.register(RecordIndexOp(draft, indexer=self.indexer))
return request_item

0 comments on commit 89ea407

Please sign in to comment.