From 5c1312f38e8968e068125a1b1dd59060f3f29bfe Mon Sep 17 00:00:00 2001 From: skyblue Date: Sat, 12 Apr 2014 09:42:09 +0800 Subject: clean oauth2 code --- models/oauth2.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'models') diff --git a/models/oauth2.go b/models/oauth2.go index e50d4039fd..c5d58c0749 100644 --- a/models/oauth2.go +++ b/models/oauth2.go @@ -6,8 +6,6 @@ package models import ( "errors" - - "github.com/gogits/gogs/modules/log" ) // OT: Oauth2 Type @@ -20,7 +18,6 @@ const ( var ( ErrOauth2RecordNotExists = errors.New("not exists oauth2 record") ErrOauth2NotAssociatedWithUser = errors.New("not associated with user") - ErrOauth2NotExist = errors.New("not exist oauth2") ) type Oauth2 struct { @@ -61,12 +58,11 @@ func GetOauth2(identity string) (oa *Oauth2, err error) { func GetOauth2ById(id int64) (oa *Oauth2, err error) { oa = new(Oauth2) has, err := orm.Id(id).Get(oa) - log.Info("oa: %v", oa) if err != nil { return nil, err } if !has { - return nil, ErrOauth2NotExist + return nil, ErrOauth2RecordNotExists } return oa, nil } -- cgit v1.2.3