Implementation of the feature to redirect to an external issue tracker

This commit is contained in:
Rémy Boulanouar
2016-11-04 09:06:54 +01:00
parent 4a5faecd8f
commit 8dc49dc114
7 changed files with 18 additions and 3 deletions

View File

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