Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)

* site admin could create repos even MAX_CREATION_LIMIT=0

* Optimize if structure
tokarchuk/v1.17
Lunny Xiao 6 years ago committed by GitHub
parent 0e464995ce
commit 578cf52ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      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}
}

Loading…
Cancel
Save