diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/org_team.go | 4 | ||||
-rw-r--r-- | models/repo.go | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/models/org_team.go b/models/org_team.go index 8508a176c1..bc0e12b504 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -192,8 +192,8 @@ func (t *Team) RemoveRepository(repoID int64) error { return sess.Commit() } -// EnableUnit returns if the team enables unit type t -func (t *Team) EnableUnit(tp UnitType) bool { +// UnitEnabled returns if the team has the given unit type enabled +func (t *Team) UnitEnabled(tp UnitType) bool { if len(t.UnitTypes) == 0 { return true } diff --git a/models/repo.go b/models/repo.go index a651aae89b..60c89836c0 100644 --- a/models/repo.go +++ b/models/repo.go @@ -398,8 +398,8 @@ func (repo *Repository) getUnitsByUserID(e Engine, userID int64, isAdmin bool) ( return nil } -// EnableUnit if this repository enabled some unit -func (repo *Repository) EnableUnit(tp UnitType) bool { +// UnitEnabled if this repository has the given unit enabled +func (repo *Repository) UnitEnabled(tp UnitType) bool { repo.getUnits(x) for _, unit := range repo.Units { if unit.Type == tp { @@ -658,7 +658,7 @@ func (repo *Repository) CanEnablePulls() bool { // AllowsPulls returns true if repository meets the requirements of accepting pulls and has them enabled. func (repo *Repository) AllowsPulls() bool { - return repo.CanEnablePulls() && repo.EnableUnit(UnitTypePullRequests) + return repo.CanEnablePulls() && repo.UnitEnabled(UnitTypePullRequests) } // CanEnableEditor returns true if repository meets the requirements of web editor. |