diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-08-09 11:31:57 +0800 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-08-09 06:31:57 +0300 |
commit | eb8c611b1d50fcc6c33907430b3caa5e596eb186 (patch) | |
tree | 99bfede3bd99627370f3351fdcac05d09bc5152a | |
parent | b1eaeeb0cda19211f1ec9dbf62d665672e6d990c (diff) | |
download | gitea-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.go | 2 |
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} } |