Skip to content

Commit 578cf52

Browse files
authored
Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)
* site admin could create repos even MAX_CREATION_LIMIT=0 * Optimize if structure
1 parent 0e46499 commit 578cf52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ func createRepository(e *xorm.Session, doer, u *User, repo *Repository) (err err
14111411

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

0 commit comments

Comments
 (0)