summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-02-19 15:04:50 -0500
committerUnknwon <u@gogs.io>2016-02-19 15:04:50 -0500
commit2408df3f3549bdddb16c7ce01e9cf5a2e18c0df5 (patch)
treea86642f774a8bd6a30ebc0b85575d2c1594c83b7 /routers
parent736a46dff96430f4ee43e6a2eb1bccbccaa611d4 (diff)
parenta1b28fc33c4a685ffe9a07f67fa6786ec27524bb (diff)
downloadgitea-2408df3f3549bdddb16c7ce01e9cf5a2e18c0df5.tar.gz
gitea-2408df3f3549bdddb16c7ce01e9cf5a2e18c0df5.zip
Merge pull request #2663 from Download-Fritz/MirrorForks
#2505 Allow to fork and disallow to create PRs for mirrors.
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/issue.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 635dee930e..400da72029 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -47,9 +47,9 @@ func MustEnableIssues(ctx *middleware.Context) {
}
}
-func MustEnablePulls(ctx *middleware.Context) {
- 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)
@@ -71,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
}