0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-23 18:04:30 +01:00

Fix update user (#18878)

This commit is contained in:
Lunny Xiao 2022-02-25 02:29:10 +08:00 committed by GitHub
parent f1b1472632
commit 6621710deb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -868,13 +868,14 @@ func updateUser(ctx context.Context, u *User, changePrimaryEmail bool, cols ...s
} }
if !primaryEmailExist { if !primaryEmailExist {
_, err = e.Insert(&EmailAddress{ if _, err := e.Insert(&EmailAddress{
Email: u.Email, Email: u.Email,
UID: u.ID, UID: u.ID,
IsActivated: true, IsActivated: true,
IsPrimary: true, IsPrimary: true,
}) }); err != nil {
return err return err
}
} }
} }