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
This commit is contained in:
Lunny Xiao 2018-08-09 11:31:57 +08:00 committed by Lauris BH
parent b1eaeeb0cd
commit eb8c611b1d
1 changed files with 1 additions and 1 deletions

View File

@ -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}
}