Fix update user bug (#18250)

tokarchuk/v1.17
Lunny Xiao 3 years ago committed by GitHub
parent ba9e4e2570
commit 67d73882f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      models/user/user.go

@ -855,7 +855,7 @@ func updateUser(ctx context.Context, 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

Loading…
Cancel
Save