Skip to content

Commit

Permalink
Fix update user (go-gitea#18878)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored and Stelios Malathouras committed Mar 28, 2022
1 parent e3ed0ef commit e1d8d25
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions models/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,13 +868,14 @@ 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,
})
return err
}); err != nil {
return err
}
}
}

Expand Down

0 comments on commit e1d8d25

Please sign in to comment.