aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-08-09 09:04:16 +0800
committerGitHub <noreply@github.com>2018-08-09 09:04:16 +0800
commit578cf52ce5baf166dc5e4eeaca7814b3253bab5e (patch)
treede9477a68f96e2c87ddbea5d034ed0777cf69eed /models/repo.go
parent0e464995cefa381b0bc8703998c1b653ae4e3586 (diff)
downloadgitea-578cf52ce5baf166dc5e4eeaca7814b3253bab5e.tar.gz
gitea-578cf52ce5baf166dc5e4eeaca7814b3253bab5e.zip
Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)
* site admin could create repos even MAX_CREATION_LIMIT=0 * Optimize if structure
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index 3c4908b0d8..25f70bf1a1 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1411,7 +1411,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}
}