Fix update user bug (#18251)

This commit is contained in:
Lunny Xiao 2022-01-12 22:10:03 +08:00 committed by GitHub
parent c719841f0d
commit 37abfcaf8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1095,7 +1095,7 @@ func updateUser(e Engine, u *User, changePrimaryEmail bool) error {
if _, err := e.Insert(&emailAddress); err != nil {
return err
}
} else if _, err := e.ID(emailAddress).Cols("is_primary").Update(&EmailAddress{
} else if _, err := e.ID(emailAddress.ID).Cols("is_primary").Update(&EmailAddress{
IsPrimary: true,
}); err != nil {
return err