diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-07-03 18:05:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-03 12:05:59 +0200 |
commit | f1cb461c1fb23b68ae34ada2de6bad3bfa6ceeca (patch) | |
tree | 2f81e7d4db0acaab49b2bd292b2843fa7c526b64 /models/user | |
parent | 45bc180a15d1edf3a20f25c4bb428819b94e6ad9 (diff) | |
download | gitea-f1cb461c1fb23b68ae34ada2de6bad3bfa6ceeca.tar.gz gitea-f1cb461c1fb23b68ae34ada2de6bad3bfa6ceeca.zip |
Fix bug when change user name (#25637)
Fix #25621
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'models/user')
-rw-r--r-- | models/user/redirect.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/models/user/redirect.go b/models/user/redirect.go index 9d8903c059..42e991888a 100644 --- a/models/user/redirect.go +++ b/models/user/redirect.go @@ -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 } |