Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
forgefriends
Forgefriends
Commits
67d73882
Unverified
Commit
67d73882
authored
Jan 12, 2022
by
Lunny Xiao
Committed by
GitHub
Jan 12, 2022
Browse files
Fix update user bug (#18250)
parent
ba9e4e25
Changes
1
Hide whitespace changes
Inline
Side-by-side
models/user/user.go
View file @
67d73882
...
...
@@ -855,7 +855,7 @@ func updateUser(ctx context.Context, u *User, changePrimaryEmail bool) error {
if
_
,
err
:=
e
.
Insert
(
&
emailAddress
);
err
!=
nil
{
return
err
}
}
else
if
_
,
err
:=
e
.
ID
(
emailAddress
)
.
Cols
(
"is_primary"
)
.
Update
(
&
EmailAddress
{
}
else
if
_
,
err
:=
e
.
ID
(
emailAddress
.
ID
)
.
Cols
(
"is_primary"
)
.
Update
(
&
EmailAddress
{
IsPrimary
:
true
,
});
err
!=
nil
{
return
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment