Skip to content

Commit 64ed262

Browse files
GiteaBotlunny
andauthored
Fix bug when change user name (#25637) (#25646)
Backport #25637 by @lunny Fix #25621 Co-authored-by: Lunny Xiao <[email protected]>
1 parent f51c8e0 commit 64ed262

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/user/redirect.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ func NewUserRedirect(ctx context.Context, ID int64, oldUserName, newUserName str
6464
oldUserName = strings.ToLower(oldUserName)
6565
newUserName = strings.ToLower(newUserName)
6666

67+
if err := DeleteUserRedirect(ctx, oldUserName); err != nil {
68+
return err
69+
}
70+
6771
if err := DeleteUserRedirect(ctx, newUserName); err != nil {
6872
return err
6973
}

0 commit comments

Comments
 (0)