Skip to content

Commit

Permalink
Site admin could create repos even MAX_CREATION_LIMIT=0 (go-gitea#4645)
Browse files Browse the repository at this point in the history
* site admin could create repos even MAX_CREATION_LIMIT=0

* Optimize if structure
  • Loading branch information
lunny committed Aug 9, 2018
1 parent b1eaeeb commit 71828f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}

Expand Down

0 comments on commit 71828f9

Please sign in to comment.