diff options
author | Unknwon <u@gogs.io> | 2017-03-22 13:20:29 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-22 13:20:29 -0400 |
commit | 85a050fca70446ea7a9e10266bbe083d5d8b63ea (patch) | |
tree | 23d3fcc2ce2fbd7f289477c1214ac0768e24d85b /routers/api/v1/repo/issue.go | |
parent | bb86d66496078b8c2fb242b6286d682ff9d5aa2f (diff) |
issue: fix redirect to random issue if index does not exist (#4315)
Diffstat (limited to 'routers/api/v1/repo/issue.go')
-rw-r--r-- | routers/api/v1/repo/issue.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 97b058a9..ffb52b9c 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -64,7 +64,7 @@ func ListIssues(ctx *context.APIContext) { func GetIssue(ctx *context.APIContext) { issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index")) if err != nil { - if models.IsErrIssueNotExist(err) { + if errors.IsIssueNotExist(err) { ctx.Status(404) } else { ctx.Error(500, "GetIssueByIndex", err) @@ -126,7 +126,7 @@ func CreateIssue(ctx *context.APIContext, form api.CreateIssueOption) { func EditIssue(ctx *context.APIContext, form api.EditIssueOption) { issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index")) if err != nil { - if models.IsErrIssueNotExist(err) { + if errors.IsIssueNotExist(err) { ctx.Status(404) } else { ctx.Error(500, "GetIssueByIndex", err) |