Skip to content

Commit

Permalink
Fix bug when change user name (#25637)
Browse files Browse the repository at this point in the history
Fix #25621

Co-authored-by: Giteabot <teabot@gitea.io>
  • Loading branch information
lunny and GiteaBot authored Jul 3, 2023
1 parent 45bc180 commit f1cb461
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 f1cb461

Please sign in to comment.