remove ctx.Repo.IsValid

tokarchuk/v1.17
slene 11 years ago
parent 105f97e61c
commit 41ca0ed302
  1. 20
      routers/repo/issue.go

@ -20,10 +20,6 @@ import (
) )
func Issues(ctx *middleware.Context) { func Issues(ctx *middleware.Context) {
if !ctx.Repo.IsValid {
ctx.Handle(404, "issue.Issues(invalid repo):", nil)
}
ctx.Data["Title"] = "Issues" ctx.Data["Title"] = "Issues"
ctx.Data["IsRepoToolbarIssues"] = true ctx.Data["IsRepoToolbarIssues"] = true
ctx.Data["IsRepoToolbarIssuesList"] = true ctx.Data["IsRepoToolbarIssuesList"] = true
@ -80,10 +76,6 @@ func Issues(ctx *middleware.Context) {
} }
func CreateIssue(ctx *middleware.Context, params martini.Params, form auth.CreateIssueForm) { func CreateIssue(ctx *middleware.Context, params martini.Params, form auth.CreateIssueForm) {
if !ctx.Repo.IsValid {
ctx.Handle(404, "issue.CreateIssue(invalid repo):", nil)
}
ctx.Data["Title"] = "Create issue" ctx.Data["Title"] = "Create issue"
ctx.Data["IsRepoToolbarIssues"] = true ctx.Data["IsRepoToolbarIssues"] = true
ctx.Data["IsRepoToolbarIssuesList"] = false ctx.Data["IsRepoToolbarIssuesList"] = false
@ -126,10 +118,6 @@ func CreateIssue(ctx *middleware.Context, params martini.Params, form auth.Creat
} }
func ViewIssue(ctx *middleware.Context, params martini.Params) { func ViewIssue(ctx *middleware.Context, params martini.Params) {
if !ctx.Repo.IsValid {
ctx.Handle(404, "issue.ViewIssue(invalid repo):", nil)
}
index, err := base.StrTo(params["index"]).Int() index, err := base.StrTo(params["index"]).Int()
if err != nil { if err != nil {
ctx.Handle(404, "issue.ViewIssue", err) ctx.Handle(404, "issue.ViewIssue", err)
@ -183,10 +171,6 @@ func ViewIssue(ctx *middleware.Context, params martini.Params) {
} }
func UpdateIssue(ctx *middleware.Context, params martini.Params, form auth.CreateIssueForm) { func UpdateIssue(ctx *middleware.Context, params martini.Params, form auth.CreateIssueForm) {
if !ctx.Repo.IsValid {
ctx.Handle(404, "issue.UpdateIssue(invalid repo):", nil)
}
index, err := base.StrTo(params["index"]).Int() index, err := base.StrTo(params["index"]).Int()
if err != nil { if err != nil {
ctx.Handle(404, "issue.UpdateIssue", err) ctx.Handle(404, "issue.UpdateIssue", err)
@ -226,10 +210,6 @@ func UpdateIssue(ctx *middleware.Context, params martini.Params, form auth.Creat
} }
func Comment(ctx *middleware.Context, params martini.Params) { func Comment(ctx *middleware.Context, params martini.Params) {
if !ctx.Repo.IsValid {
ctx.Handle(404, "issue.Comment(invalid repo):", nil)
}
index, err := base.StrTo(ctx.Query("issueIndex")).Int64() index, err := base.StrTo(ctx.Query("issueIndex")).Int64()
if err != nil { if err != nil {
ctx.Handle(404, "issue.Comment(get index)", err) ctx.Handle(404, "issue.Comment(get index)", err)

Loading…
Cancel
Save