Email address might be stored twice in database #11251
Labels
issue/confirmed
Issue has been reviewed and confirmed to be present or accepted to be implemented
type/bug
[x]
):Description
It is possible to use 'Manage Email Addresses' to add an email that already exists, if the specified email is primary. Specifically, the
isEmailUsed
inmodels/user_mail.go
only checks for duplicates inemail_address
table, but we also store the email inuser
table. This leads to an odd situation, where same email is present twice in database.The same is possible if
MakeEmailPrimary
is executed, as it does not remove previous entry fromemail_address
table.We should most likely remove email from
user
table and keep separate column for whether email is primary or not, inemail_address
.The above results in duplicate entries being presented in
User Emails
part ofSite Administration
.The text was updated successfully, but these errors were encountered: