summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Östanbäck <cez81@users.noreply.github.com>2017-05-20 10:47:48 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-05-20 16:47:48 +0800
commit85a73965256411c36ecc050eeb7967d3c8ef20d5 (patch)
tree7af56c03402030947be62409f4f3bcf3ac7c075c
parentbe5323a05fed04ede6dd7d0ca1f8ac3476536906 (diff)
downloadgitea-85a73965256411c36ecc050eeb7967d3c8ef20d5.tar.gz
gitea-85a73965256411c36ecc050eeb7967d3c8ef20d5.zip
Add error direclty when user tries to create new repo and limit already hit (#1767)
-rw-r--r--routers/repo/repo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 9b411648c6..e2e2dc7a3b 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -67,6 +67,10 @@ func checkContextUser(ctx *context.Context, uid int64) *models.User {
// Create render creating repository page
func Create(ctx *context.Context) {
+ if !ctx.User.CanCreateRepo() {
+ ctx.RenderWithErr(ctx.Tr("repo.form.reach_limit_of_creation", ctx.User.RepoCreationNum()), tplCreate, nil)
+ }
+
ctx.Data["Title"] = ctx.Tr("new_repo")
// Give default value for template to render.