diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-01-12 21:58:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 21:58:09 +0800 |
commit | 67d73882f4ade433fa8292784a5f5d0b8df50cb6 (patch) | |
tree | 9d23e8f4ba05abc3e01c9913fe526e5d994a2a7a /models/user | |
parent | ba9e4e25705b04fbcd6ebe61c8dd0aa075dc3b0e (diff) | |
download | gitea-67d73882f4ade433fa8292784a5f5d0b8df50cb6.tar.gz gitea-67d73882f4ade433fa8292784a5f5d0b8df50cb6.zip |
Fix update user bug (#18250)
Diffstat (limited to 'models/user')
-rw-r--r-- | models/user/user.go | 2 |
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 |