diff options
author | Unknwon <u@gogs.io> | 2017-03-16 17:18:43 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-16 17:18:43 -0400 |
commit | 0ccd7c97abcb1ae314c9c17b0c08863cb13115fa (patch) | |
tree | d5314ef88257d64b3749194c024ca853486f799e /modules/auth | |
parent | 4e64e71e28dcfb9ef41d7cbc63ff1474ad8e5126 (diff) |
models: rename ErrUserNotExist -> errors.UserNotExist
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/auth.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go index 2e96ec1a..6ec3afc6 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -14,6 +14,7 @@ import ( "gopkg.in/macaron.v1" "github.com/gogits/gogs/models" + "github.com/gogits/gogs/models/errors" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/setting" ) @@ -65,7 +66,7 @@ func SignedInID(ctx *macaron.Context, sess session.Store) int64 { } if id, ok := uid.(int64); ok { if _, err := models.GetUserByID(id); err != nil { - if !models.IsErrUserNotExist(err) { + if !errors.IsUserNotExist(err) { log.Error(2, "GetUserById: %v", err) } return 0 @@ -90,7 +91,7 @@ func SignedInUser(ctx *macaron.Context, sess session.Store) (*models.User, bool) if len(webAuthUser) > 0 { u, err := models.GetUserByName(webAuthUser) if err != nil { - if !models.IsErrUserNotExist(err) { + if !errors.IsUserNotExist(err) { log.Error(4, "GetUserByName: %v", err) return nil, false } @@ -125,7 +126,7 @@ func SignedInUser(ctx *macaron.Context, sess session.Store) (*models.User, bool) u, err := models.UserSignIn(uname, passwd) if err != nil { - if !models.IsErrUserNotExist(err) { + if !errors.IsUserNotExist(err) { log.Error(4, "UserSignIn: %v", err) } return nil, false |