aboutsummaryrefslogtreecommitdiffstats
path: root/models/user/user.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-01-12 21:58:09 +0800
committerGitHub <noreply@github.com>2022-01-12 21:58:09 +0800
commit67d73882f4ade433fa8292784a5f5d0b8df50cb6 (patch)
tree9d23e8f4ba05abc3e01c9913fe526e5d994a2a7a /models/user/user.go
parentba9e4e25705b04fbcd6ebe61c8dd0aa075dc3b0e (diff)
downloadgitea-67d73882f4ade433fa8292784a5f5d0b8df50cb6.tar.gz
gitea-67d73882f4ade433fa8292784a5f5d0b8df50cb6.zip
Fix update user bug (#18250)
Diffstat (limited to 'models/user/user.go')
-rw-r--r--models/user/user.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user/user.go b/models/user/user.go
index 8efd51c9be..57a7fcadfa 100644
--- a/models/user/user.go
+++ b/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