|
|
@ -868,15 +868,16 @@ func updateUser(ctx context.Context, u *User, changePrimaryEmail bool, cols ...s |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if !primaryEmailExist { |
|
|
|
if !primaryEmailExist { |
|
|
|
_, err = e.Insert(&EmailAddress{ |
|
|
|
if _, err := e.Insert(&EmailAddress{ |
|
|
|
Email: u.Email, |
|
|
|
Email: u.Email, |
|
|
|
UID: u.ID, |
|
|
|
UID: u.ID, |
|
|
|
IsActivated: true, |
|
|
|
IsActivated: true, |
|
|
|
IsPrimary: true, |
|
|
|
IsPrimary: true, |
|
|
|
}) |
|
|
|
}); err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if len(cols) == 0 { |
|
|
|
if len(cols) == 0 { |
|
|
|
_, err = e.ID(u.ID).AllCols().Update(u) |
|
|
|
_, err = e.ID(u.ID).AllCols().Update(u) |
|
|
|