You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A production editor merged a duplicate author's accounts, but there were still duplicate FrozenAuthor records on the Edit Metadata page for the article. So he tried to click Delete to remove the spare entries, but he get a Server Error screen.
This happened because submission.models.remove_author_from_article expects to find only one ArticleAuthorOrder object for a given unique pair author+article.
joemull
changed the title
Can't delete duplicate FrozenAuthor object due to syntax around AuthorOrder
Can't delete duplicate FrozenAuthor object due to logic around AuthorOrder
Jan 28, 2022
For this to happen, it means the article already had both accounts listed as authors with the article prior to merging the acounts.
We need a unique constraint ArticleAuthorOrder.article and ArticleAuthorOrder.author. When a constraint is present, the logic for merging will only preserve the relationship existing on the account that is being preserved and discard the child object of the account to be deleted.
The same constraint would also be needed on the FrozenAuthor model.
Describe the bug
A production editor merged a duplicate author's accounts, but there were still duplicate FrozenAuthor records on the Edit Metadata page for the article. So he tried to click Delete to remove the spare entries, but he get a Server Error screen.
This happened because
submission.models.remove_author_from_article
expects to find only one ArticleAuthorOrder object for a given unique pair author+article.Expected behavior
The function would ideally only remove the ArticleAuthorOrder object corresponding to the duplicate FrozenAuthor.
Janeway version
1.4.0
The text was updated successfully, but these errors were encountered: