forked from gitea/gitea
1
0
Fork 0

Don't update email for organisation (#18905) (#18906)

Backport #18905
This commit is contained in:
Gusted 2022-02-26 02:10:21 +00:00 committed by GitHub
parent 6039138323
commit cea85c30a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -861,7 +861,7 @@ func updateUser(ctx context.Context, u *User, changePrimaryEmail bool, cols ...s
}); err != nil {
return err
}
} else { // check if primary email in email_address table
} else if !u.IsOrganization() { // check if primary email in email_address table
primaryEmailExist, err := e.Where("uid=? AND is_primary=?", u.ID, true).Exist(&EmailAddress{})
if err != nil {
return err