diff options
Diffstat (limited to 'models/repo_unit.go')
-rw-r--r-- | models/repo_unit.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/models/repo_unit.go b/models/repo_unit.go index a6162a65e5..ec680c395e 100644 --- a/models/repo_unit.go +++ b/models/repo_unit.go @@ -170,5 +170,16 @@ func (r *RepoUnit) ExternalTrackerConfig() *ExternalTrackerConfig { } func getUnitsByRepoID(e Engine, repoID int64) (units []*RepoUnit, err error) { - return units, e.Where("repo_id = ?", repoID).Find(&units) + var tmpUnits []*RepoUnit + if err := e.Where("repo_id = ?", repoID).Find(&tmpUnits); err != nil { + return nil, err + } + + for _, u := range tmpUnits { + if !u.Type.UnitGlobalDisabled() { + units = append(units, u) + } + } + + return units, nil } |