From 978dc00305f1af705ae8900977529bac6fa4c72b Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 5 Dec 2015 17:13:13 -0500 Subject: APIs: admin users --- models/login.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models/login.go') diff --git a/models/login.go b/models/login.go index 1ec5309d..5e260106 100644 --- a/models/login.go +++ b/models/login.go @@ -36,7 +36,6 @@ const ( var ( ErrAuthenticationAlreadyExist = errors.New("Authentication already exist") - ErrAuthenticationNotExist = errors.New("Authentication does not exist") ErrAuthenticationUserUsed = errors.New("Authentication has been used by some users") ) @@ -191,13 +190,14 @@ func LoginSources() ([]*LoginSource, error) { return auths, x.Find(&auths) } +// GetLoginSourceByID returns login source by given ID. func GetLoginSourceByID(id int64) (*LoginSource, error) { source := new(LoginSource) has, err := x.Id(id).Get(source) if err != nil { return nil, err } else if !has { - return nil, ErrAuthenticationNotExist + return nil, ErrAuthenticationNotExist{id} } return source, nil } -- cgit v1.2.3