#2162 completely disable builtin issue tracker when enable external tracker

This commit is contained in:
Unknwon 2016-08-04 16:32:02 -07:00
parent ee28fd9255
commit 2f105f3979
7 changed files with 17 additions and 10 deletions

View file

@ -151,6 +151,13 @@ func OrgAssignment(args ...bool) macaron.Handler {
}
}
func MustEnableIssues(ctx *context.APIContext) {
if !ctx.Repo.Repository.EnableIssues || ctx.Repo.Repository.EnableExternalTracker {
ctx.Status(404)
return
}
}
// RegisterRoutes registers all v1 APIs routes to web application.
// FIXME: custom form error response
func RegisterRoutes(m *macaron.Macaron) {
@ -252,7 +259,7 @@ func RegisterRoutes(m *macaron.Macaron) {
})
})
})
}, MustEnableIssues)
m.Group("/labels", func() {
m.Combo("").Get(repo.ListLabels).
Post(bind(api.CreateLabelOption{}), repo.CreateLabel)

View file

@ -52,7 +52,7 @@ var (
)
func MustEnableIssues(ctx *context.Context) {
if !ctx.Repo.Repository.EnableIssues {
if !ctx.Repo.Repository.EnableIssues || ctx.Repo.Repository.EnableExternalTracker {
ctx.Handle(404, "MustEnableIssues", nil)
return
}