1
0
mirror of https://github.com/go-gitea/gitea synced 2024-12-24 03:35:55 +01:00

remove ctx.Repo.IsValid

This commit is contained in:
slene 2014-03-30 10:12:42 +08:00
parent 105f97e61c
commit 41ca0ed302

@ -20,10 +20,6 @@ import (
)
func Issues(ctx *middleware.Context) {
if !ctx.Repo.IsValid {
ctx.Handle(404, "issue.Issues(invalid repo):", nil)
}
ctx.Data["Title"] = "Issues"
ctx.Data["IsRepoToolbarIssues"] = 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) {
if !ctx.Repo.IsValid {
ctx.Handle(404, "issue.CreateIssue(invalid repo):", nil)
}
ctx.Data["Title"] = "Create issue"
ctx.Data["IsRepoToolbarIssues"] = true
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) {
if !ctx.Repo.IsValid {
ctx.Handle(404, "issue.ViewIssue(invalid repo):", nil)
}
index, err := base.StrTo(params["index"]).Int()
if err != nil {
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) {
if !ctx.Repo.IsValid {
ctx.Handle(404, "issue.UpdateIssue(invalid repo):", nil)
}
index, err := base.StrTo(params["index"]).Int()
if err != nil {
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) {
if !ctx.Repo.IsValid {
ctx.Handle(404, "issue.Comment(invalid repo):", nil)
}
index, err := base.StrTo(ctx.Query("issueIndex")).Int64()
if err != nil {
ctx.Handle(404, "issue.Comment(get index)", err)