mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Merge pull request #2663 from Download-Fritz/MirrorForks
#2505 Allow to fork and disallow to create PRs for mirrors.
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user