Fix bug when change user name (#25637) (#25646)

Backport #25637 by @lunny

Fix #25621

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
pull/25656/head
Giteabot 1 year ago committed by GitHub
parent f51c8e0008
commit 64ed262e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      models/user/redirect.go

@ -64,6 +64,10 @@ func NewUserRedirect(ctx context.Context, ID int64, oldUserName, newUserName str
oldUserName = strings.ToLower(oldUserName) oldUserName = strings.ToLower(oldUserName)
newUserName = strings.ToLower(newUserName) newUserName = strings.ToLower(newUserName)
if err := DeleteUserRedirect(ctx, oldUserName); err != nil {
return err
}
if err := DeleteUserRedirect(ctx, newUserName); err != nil { if err := DeleteUserRedirect(ctx, newUserName); err != nil {
return err return err
} }

Loading…
Cancel
Save