aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-12-14 05:08:09 +0000
committerGitHub <noreply@github.com>2021-12-14 00:08:09 -0500
commitb4782e24d2821bbb5647eff2eaf5c338e92324db (patch)
tree638dd81531c08b4aab6958604704b6a2b2133705 /routers
parent8e9140dd6947c0b63e1a263686261313772e67d0 (diff)
downloadgitea-b4782e24d2821bbb5647eff2eaf5c338e92324db.tar.gz
gitea-b4782e24d2821bbb5647eff2eaf5c338e92324db.zip
Return nicer error for ForcePrivate (#17971)
Diffstat (limited to 'routers')
-rw-r--r--routers/web/repo/setting.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go
index 81009cb393..a6b1219954 100644
--- a/routers/web/repo/setting.go
+++ b/routers/web/repo/setting.go
@@ -144,7 +144,7 @@ func SettingsPost(ctx *context.Context) {
visibilityChanged := repo.IsPrivate != form.Private
// when ForcePrivate enabled, you could change public repo to private, but only admin users can change private to public
if visibilityChanged && setting.Repository.ForcePrivate && !form.Private && !ctx.User.IsAdmin {
- ctx.ServerError("Force Private enabled", errors.New("cannot change private repository to public"))
+ ctx.RenderWithErr(ctx.Tr("form.repository_force_private"), tplSettingsOptions, form)
return
}