aboutsummaryrefslogtreecommitdiff
path: root/routers/api/v1/user
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-03-16 17:18:43 -0400
committerUnknwon <u@gogs.io>2017-03-16 17:18:43 -0400
commit0ccd7c97abcb1ae314c9c17b0c08863cb13115fa (patch)
treed5314ef88257d64b3749194c024ca853486f799e /routers/api/v1/user
parent4e64e71e28dcfb9ef41d7cbc63ff1474ad8e5126 (diff)
models: rename ErrUserNotExist -> errors.UserNotExist
Diffstat (limited to 'routers/api/v1/user')
2 files changed, 4 insertions, 2 deletions
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)