aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLunny Xiao2022-01-12 22:10:03 +0800
committerGitHub2022-01-12 22:10:03 +0800
commit37abfcaf8a012076901a8847f273488e5b038031 (patch)
tree9b5fbaaa5ed053ad60ad35af4e99fc0a1712ce91
parentc719841f0d6acd78a43e65682a487c8843d06d9e (diff)
Fix update user bug (#18251)
-rw-r--r--models/user.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go
index 37876063e..cb3691fb9 100644
--- a/models/user.go
+++ b/models/user.go
@@ -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