diff --git a/routers/repo/issue.go b/routers/repo/issue.go index cd519b690..87b11c206 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -922,9 +922,7 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) { // Check for open dependencies if form.Status == "close" { - canbeClosed := models.IssueNoDependenciesLeft(issue) - - if !canbeClosed { + if models.IssueNoDependenciesLeft(issue) { if issue.IsPull { ctx.Flash.Error("You need to close all issues blocking this pull request before you can merge it!") ctx.Redirect(fmt.Sprintf("%s/pulls/%d", ctx.Repo.RepoLink, issue.Index)) diff --git a/routers/repo/pull.go b/routers/repo/pull.go index caeddaa00..ef7096863 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -428,9 +428,8 @@ func MergePullRequest(ctx *context.Context) { pr.Issue = issue pr.Issue.Repo = ctx.Repo.Repository - canbeClosed := models.IssueNoDependenciesLeft(issue) - if !canbeClosed { + if !models.IssueNoDependenciesLeft(issue) { ctx.Flash.Error("You need to close all issues blocking this pull request before you can merge it!") ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pr.Index)) return