Skip to content

Commit eb8c611

Browse files
lunnylafriks
authored andcommitted
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
1 parent b1eaeeb commit eb8c611

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/repo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ func createRepository(e *xorm.Session, doer, u *User, repo *Repository) (err err
14071407

14081408
// CreateRepository creates a repository for the user/organization u.
14091409
func CreateRepository(doer, u *User, opts CreateRepoOptions) (_ *Repository, err error) {
1410-
if !u.CanCreateRepo() {
1410+
if !doer.IsAdmin && !u.CanCreateRepo() {
14111411
return nil, ErrReachLimitOfRepo{u.MaxRepoCreation}
14121412
}
14131413

0 commit comments

Comments
 (0)