Skip to content

Commit

Permalink
Fix bug when change user name (#25637) (#25645)
Browse files Browse the repository at this point in the history
Backport #25637 by @lunny

Fix #25621

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
GiteaBot and lunny authored Jul 3, 2023
1 parent 45d8d63 commit 37bf5e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/user/redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ func NewUserRedirect(ctx context.Context, ID int64, oldUserName, newUserName str
oldUserName = strings.ToLower(oldUserName)
newUserName = strings.ToLower(newUserName)

if err := DeleteUserRedirect(ctx, oldUserName); err != nil {
return err
}

if err := DeleteUserRedirect(ctx, newUserName); err != nil {
return err
}
Expand Down

0 comments on commit 37bf5e7

Please sign in to comment.