From 0ccd7c97abcb1ae314c9c17b0c08863cb13115fa Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 16 Mar 2017 17:18:43 -0400 Subject: models: rename ErrUserNotExist -> errors.UserNotExist --- routers/api/v1/user/key.go | 3 ++- routers/api/v1/user/user.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'routers/api/v1/user') diff --git a/routers/api/v1/user/key.go b/routers/api/v1/user/key.go index 3e407fef..941cfb60 100644 --- a/routers/api/v1/user/key.go +++ b/routers/api/v1/user/key.go @@ -8,6 +8,7 @@ import ( api "github.com/gogits/go-gogs-client" "github.com/gogits/gogs/models" + "github.com/gogits/gogs/models/errors" "github.com/gogits/gogs/modules/context" "github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/routers/api/v1/convert" @@ -17,7 +18,7 @@ import ( func GetUserByParamsName(ctx *context.APIContext, name string) *models.User { user, err := models.GetUserByName(ctx.Params(name)) if err != nil { - if models.IsErrUserNotExist(err) { + if errors.IsUserNotExist(err) { ctx.Status(404) } else { ctx.Error(500, "GetUserByName", err) diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go index b526af5d..b1f06ec7 100644 --- a/routers/api/v1/user/user.go +++ b/routers/api/v1/user/user.go @@ -10,6 +10,7 @@ import ( api "github.com/gogits/go-gogs-client" "github.com/gogits/gogs/models" + "github.com/gogits/gogs/models/errors" "github.com/gogits/gogs/modules/context" ) @@ -54,7 +55,7 @@ func Search(ctx *context.APIContext) { func GetInfo(ctx *context.APIContext) { u, err := models.GetUserByName(ctx.Params(":username")) if err != nil { - if models.IsErrUserNotExist(err) { + if errors.IsUserNotExist(err) { ctx.Status(404) } else { ctx.Error(500, "GetUserByName", err) -- cgit v1.2.3