aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-08-09 11:31:57 +0800
committerLauris BH <lauris@nix.lv>2018-08-09 06:31:57 +0300
commiteb8c611b1d50fcc6c33907430b3caa5e596eb186 (patch)
tree99bfede3bd99627370f3351fdcac05d09bc5152a
parentb1eaeeb0cda19211f1ec9dbf62d665672e6d990c (diff)
downloadgitea-eb8c611b1d50fcc6c33907430b3caa5e596eb186.tar.gz
gitea-eb8c611b1d50fcc6c33907430b3caa5e596eb186.zip
Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645) (#4650)
* site admin could create repos even MAX_CREATION_LIMIT=0 * Optimize if structure
-rw-r--r--models/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index 12ded1b0ac..5fdc248dec 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1407,7 +1407,7 @@ func createRepository(e *xorm.Session, doer, u *User, repo *Repository) (err err
// CreateRepository creates a repository for the user/organization u.
func CreateRepository(doer, u *User, opts CreateRepoOptions) (_ *Repository, err error) {
- if !u.CanCreateRepo() {
+ if !doer.IsAdmin && !u.CanCreateRepo() {
return nil, ErrReachLimitOfRepo{u.MaxRepoCreation}
}