Skip to content

Commit 33e19c8

Browse files
Gustedlunny
andauthored
Don't update email for organisation (#18905)
- Fix regression caused by: f1b1472 - Don't try to insert a email for Organisation(as they don't have one). - Resolves #18891 Co-authored-by: Lunny Xiao <[email protected]>
1 parent fd273b0 commit 33e19c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/user/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ func updateUser(ctx context.Context, u *User, changePrimaryEmail bool, cols ...s
861861
}); err != nil {
862862
return err
863863
}
864-
} else { // check if primary email in email_address table
864+
} else if !u.IsOrganization() { // check if primary email in email_address table
865865
primaryEmailExist, err := e.Where("uid=? AND is_primary=?", u.ID, true).Exist(&EmailAddress{})
866866
if err != nil {
867867
return err

0 commit comments

Comments
 (0)