diff options
Diffstat (limited to 'models/issue_dependency.go')
-rw-r--r-- | models/issue_dependency.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/models/issue_dependency.go b/models/issue_dependency.go index 157e9257c4..ffa972c106 100644 --- a/models/issue_dependency.go +++ b/models/issue_dependency.go @@ -113,8 +113,11 @@ func issueDepExists(e Engine, issueID int64, depID int64) (bool, error) { // IssueNoDependenciesLeft checks if issue can be closed func IssueNoDependenciesLeft(issue *Issue) (bool, error) { + return issueNoDependenciesLeft(x, issue) +} - exists, err := x. +func issueNoDependenciesLeft(e Engine, issue *Issue) (bool, error) { + exists, err := e. Table("issue_dependency"). Select("issue.*"). Join("INNER", "issue", "issue.id = issue_dependency.dependency_id"). @@ -127,9 +130,13 @@ func IssueNoDependenciesLeft(issue *Issue) (bool, error) { // IsDependenciesEnabled returns if dependecies are enabled and returns the default setting if not set. func (repo *Repository) IsDependenciesEnabled() bool { + return repo.isDependenciesEnabled(x) +} + +func (repo *Repository) isDependenciesEnabled(e Engine) bool { var u *RepoUnit var err error - if u, err = repo.GetUnit(UnitTypeIssues); err != nil { + if u, err = repo.getUnit(e, UnitTypeIssues); err != nil { log.Trace("%s", err) return setting.Service.DefaultEnableDependencies } |