Simplified checks for open dependencies
Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
parent
c1ea3f588d
commit
1b8b2fc17d
|
|
@ -922,9 +922,7 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
|
||||||
// Check for open dependencies
|
// Check for open dependencies
|
||||||
if form.Status == "close" {
|
if form.Status == "close" {
|
||||||
|
|
||||||
canbeClosed := models.IssueNoDependenciesLeft(issue)
|
if models.IssueNoDependenciesLeft(issue) {
|
||||||
|
|
||||||
if !canbeClosed {
|
|
||||||
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))
|
||||||
|
|
|
||||||
|
|
@ -428,9 +428,8 @@ func MergePullRequest(ctx *context.Context) {
|
||||||
|
|
||||||
pr.Issue = issue
|
pr.Issue = issue
|
||||||
pr.Issue.Repo = ctx.Repo.Repository
|
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.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))
|
ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pr.Index))
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user