Skip to content

Instantly share code, notes, and snippets.

@kolaente
Created November 1, 2017 20:18
Show Gist options
  • Save kolaente/88706f4105b6b15b72987ec9201fcf92 to your computer and use it in GitHub Desktop.
Save kolaente/88706f4105b6b15b72987ec9201fcf92 to your computer and use it in GitHub Desktop.
Gitea Go checking for open dependencies
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