aboutsummaryrefslogtreecommitdiff
path: root/routers/api/v1/repo/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-03-22 13:20:29 -0400
committerUnknwon <u@gogs.io>2017-03-22 13:20:29 -0400
commit85a050fca70446ea7a9e10266bbe083d5d8b63ea (patch)
tree23d3fcc2ce2fbd7f289477c1214ac0768e24d85b /routers/api/v1/repo/issue.go
parentbb86d66496078b8c2fb242b6286d682ff9d5aa2f (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.go4
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)