aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authorDownload-Fritz <download-fritz@outlook.com>2016-02-19 20:48:32 +0100
committerDownload-Fritz <download-fritz@outlook.com>2016-02-19 20:48:32 +0100
commita1b28fc33c4a685ffe9a07f67fa6786ec27524bb (patch)
tree0caf9e71fab436c0128cf5904944f4c128a38d86 /routers/repo
parenta467184e13e4e3867031c191263dc0adaec2673c (diff)
downloadgitea-a1b28fc33c4a685ffe9a07f67fa6786ec27524bb.tar.gz
gitea-a1b28fc33c4a685ffe9a07f67fa6786ec27524bb.zip
Rename MustEnablePulls() to MustAllowPulls() and simplify the contained check to AllowsPulls().
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/issue.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 76822eb05e..400da72029 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -47,11 +47,9 @@ func MustEnableIssues(ctx *middleware.Context) {
}
}
-func MustEnablePulls(ctx *middleware.Context) {
- if !ctx.Repo.Repository.CanEnablePulls() {
- ctx.Handle(404, "Unsupported", nil)
- } else if !ctx.Repo.Repository.EnablePulls {
- ctx.Handle(404, "MustEnablePulls", nil)
+func MustAllowPulls(ctx *middleware.Context) {
+ if !ctx.Repo.Repository.AllowsPulls() {
+ ctx.Handle(404, "MustAllowPulls", nil)
}
ctx.Data["HasForkedRepo"] = ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)
@@ -73,7 +71,7 @@ func RetrieveLabels(ctx *middleware.Context) {
func Issues(ctx *middleware.Context) {
isPullList := ctx.Params(":type") == "pulls"
if isPullList {
- MustEnablePulls(ctx)
+ MustAllowPulls(ctx)
if ctx.Written() {
return
}