Skip to content

Commit 89ea407

Browse files
committed
review: fix draft indexing operations order
* 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.
1 parent a2eba5d commit 89ea407

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

invenio_rdm_records/services/review/service.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def submit(self, identity, id_, data=None, require_review=False, uow=None):
183183
# request object
184184
draft.parent.review = request
185185
uow.register(ParentRecordCommitOp(draft.parent))
186+
uow.register(RecordIndexOp(draft, indexer=self.indexer))
186187

187188
if not require_review:
188189
request_item = current_rdm_records.community_inclusion_service.include(
@@ -196,5 +197,4 @@ def submit(self, identity, id_, data=None, require_review=False, uow=None):
196197
)
197198
)
198199
)
199-
uow.register(RecordIndexOp(draft, indexer=self.indexer))
200200
return request_item

0 commit comments

Comments
 (0)