diff options
author | Unknwon <u@gogs.io> | 2015-12-05 17:13:13 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-05 17:13:13 -0500 |
commit | 978dc00305f1af705ae8900977529bac6fa4c72b (patch) | |
tree | 67587da091f590282fd2c120197249fd9b07b98f /models/login.go | |
parent | bf26808fb3fd55d74089e4f758aaac77be56f7ea (diff) | |
download | gitea-978dc00305f1af705ae8900977529bac6fa4c72b.tar.gz gitea-978dc00305f1af705ae8900977529bac6fa4c72b.zip |
APIs: admin users
Diffstat (limited to 'models/login.go')
-rw-r--r-- | models/login.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/login.go b/models/login.go index 1ec5309db4..5e26010647 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 } |