mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 18:04:14 +01:00
Fix update user (#18878)
This commit is contained in:
parent
f1b1472632
commit
6621710deb
1 changed files with 4 additions and 3 deletions
|
@ -868,15 +868,16 @@ func updateUser(ctx context.Context, u *User, changePrimaryEmail bool, cols ...s
|
|||
}
|
||||
|
||||
if !primaryEmailExist {
|
||||
_, err = e.Insert(&EmailAddress{
|
||||
if _, err := e.Insert(&EmailAddress{
|
||||
Email: u.Email,
|
||||
UID: u.ID,
|
||||
IsActivated: true,
|
||||
IsPrimary: true,
|
||||
})
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(cols) == 0 {
|
||||
_, err = e.ID(u.ID).AllCols().Update(u)
|
||||
|
|
Loading…
Reference in a new issue