summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2021-12-02 10:43:43 +0800
committerGitHub <noreply@github.com>2021-12-02 10:43:43 +0800
commitba57e30f13906ad7104da7892dc3dc79721ed2fe (patch)
tree9012da10224b8893f3798eae11fa1df8acc13906 /routers
parent7026a30fdcae2c9e9d4640e96d5074e948361d5e (diff)
downloadgitea-ba57e30f13906ad7104da7892dc3dc79721ed2fe.tar.gz
gitea-ba57e30f13906ad7104da7892dc3dc79721ed2fe.zip
fix 500 error while use a reserved name in org rename (#17878)
fix #17876 Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/org/setting.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go
index 0a328dfa4e..6c7f9ed62b 100644
--- a/routers/web/org/setting.go
+++ b/routers/web/org/setting.go
@@ -73,7 +73,7 @@ func SettingsPost(ctx *context.Context) {
ctx.RenderWithErr(ctx.Tr("form.username_been_taken"), tplSettingsOptions, &form)
return
} else if err = user_model.ChangeUserName(org.AsUser(), form.Name); err != nil {
- if err == user_model.ErrUserNameIllegal {
+ if db.IsErrNameReserved(err) || db.IsErrNamePatternNotAllowed(err) {
ctx.Data["OrgName"] = true
ctx.RenderWithErr(ctx.Tr("form.illegal_username"), tplSettingsOptions, &form)
} else {