aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorDownload-Fritz <download-fritz@outlook.com>2016-02-19 20:33:06 +0100
committerDownload-Fritz <download-fritz@outlook.com>2016-02-19 20:33:06 +0100
commita467184e13e4e3867031c191263dc0adaec2673c (patch)
treee01e62d7085e72e4a8f02142c1a5fe3571e56c4d /routers
parent2fdf8fc938295b95cbe6efb7cddb1b87c2fb81ee (diff)
downloadgitea-a467184e13e4e3867031c191263dc0adaec2673c.tar.gz
gitea-a467184e13e4e3867031c191263dc0adaec2673c.zip
#2505 Allow to fork and disallow to create PRs for mirrors.
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/issue.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 635dee930e..76822eb05e 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -48,7 +48,9 @@ func MustEnableIssues(ctx *middleware.Context) {
}
func MustEnablePulls(ctx *middleware.Context) {
- if !ctx.Repo.Repository.EnablePulls {
+ if !ctx.Repo.Repository.CanEnablePulls() {
+ ctx.Handle(404, "Unsupported", nil)
+ } else if !ctx.Repo.Repository.EnablePulls {
ctx.Handle(404, "MustEnablePulls", nil)
}