Created
November 1, 2017 20:18
-
-
Save kolaente/88706f4105b6b15b72987ec9201fcf92 to your computer and use it in GitHub Desktop.
Gitea Go checking for open dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if noDeps, err := models.IssueNoDependenciesLeft(issue); err != nil { | |
return | |
} | |
if form.Status == "close" && !noDeps { | |
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)) | |
} else { | |
ctx.Flash.Error("You need to close all issues blocking this issue before you can close it!") | |
ctx.Redirect(fmt.Sprintf("%s/issues/%d", ctx.Repo.RepoLink, issue.Index)) | |
} | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment