Simplified checking for open dependencies

Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
Konrad Langenberg 2017-09-24 16:29:25 +02:00 committed by Konrad
parent 837c917798
commit fe8181af73
2 changed files with 9 additions and 12 deletions

View File

@ -920,9 +920,7 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
!(issue.IsPull && issue.PullRequest.HasMerged) { !(issue.IsPull && issue.PullRequest.HasMerged) {
// Check for open dependencies // Check for open dependencies
if form.Status == "close" { if form.Status == "close" && models.IssueNoDependenciesLeft(issue) {
if models.IssueNoDependenciesLeft(issue) {
if issue.IsPull { if issue.IsPull {
ctx.Flash.Error("You need to close all issues blocking this pull request before you can merge it!") 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)) ctx.Redirect(fmt.Sprintf("%s/pulls/%d", ctx.Repo.RepoLink, issue.Index))
@ -932,7 +930,6 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
} }
return return
} }
}
// Duplication and conflict check should apply to reopen pull request. // Duplication and conflict check should apply to reopen pull request.
var pr *models.PullRequest var pr *models.PullRequest