diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-08-02 01:46:54 -0700 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-08-02 11:46:54 +0300 |
commit | f29458bd3a20d2d89638d5031d801c161f456374 (patch) | |
tree | 959c680d58eb5cfd82d719357759963fa7095fe6 /models/repo.go | |
parent | 539d9f4c3070abb0f024b133a4f53187a76cbcb7 (diff) | |
download | gitea-f29458bd3a20d2d89638d5031d801c161f456374.tar.gz gitea-f29458bd3a20d2d89638d5031d801c161f456374.zip |
EnableUnit() -> UnitEnabled() (#2242)
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 6 |
1 files changed, 3 insertions, 3 deletions
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. |