Skip to content

Commit

Permalink
deposit: really remove old user email when present
Browse files Browse the repository at this point in the history
* It is not enough to remove the `current_user_mail` legacy field from
  the merge comparison, but it must be removed also by the dump when
  merging the deposit and the record.
  • Loading branch information
ntarocco authored and zzacharo committed Nov 15, 2024
1 parent a5539c8 commit 3e6bc2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cds/modules/invenio_deposit/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,16 @@ def merge_with_published(self):
args = [lca.dumps(), first.dumps(), self.dumps()]
for arg in args:
del arg["$schema"], arg["_deposit"]
# pop optional removed key `current_user_mail` when present
# skip legacy `current_user_mail` when comparing for merging
arg.get("_cds", {}).pop("current_user_mail", None)
args.append({})
m = Merger(*args)
try:
m.run()
except UnresolvedConflictsException:
raise MergeConflict()
# remove legacy `current_user_mail` when merging
lca.get("_cds", {}).pop("current_user_mail", None)
return patch(m.unified_patches, lca)

@index
Expand Down

0 comments on commit 3e6bc2c

Please sign in to comment.