Skip to content

Commit

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

Fix go-gitea#25621

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 37bf5e7)
  • Loading branch information
GiteaBot authored and Loïc Dachary committed Jul 5, 2023
1 parent 3d7e1ce commit 2779646
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 2779646

Please sign in to comment.