diff options
author | Gusted | 2022-02-26 02:10:21 +0000 |
---|---|---|
committer | GitHub | 2022-02-26 03:10:21 +0100 |
commit | cea85c30a455cc91f230856c49b39fc60f6a10ca (patch) | |
tree | e4d483220545f42cb4c006d430d0e1bed1bdd81e | |
parent | 6039138323ce037f0a499aef8a968d374e2a9edc (diff) |
Don't update email for organisation (#18905) (#18906)
Backport #18905
-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 efc9fb296..ba528012c 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -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 |