From: Unknown Date: Wed, 9 Apr 2014 18:15:09 +0000 (-0400) Subject: Merge branch 'dev' of github.com:gogits/gogs into dev X-Git-Tag: v0.9.99~2267^2~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5f6bd323f530410c687b17b0251a5a2ffacb755b;p=gitea.git Merge branch 'dev' of github.com:gogits/gogs into dev Conflicts: models/oauth2.go --- 5f6bd323f530410c687b17b0251a5a2ffacb755b diff --cc gogs.go index 4616141e3d,4616141e3d..45be7e8712 --- a/gogs.go +++ b/gogs.go @@@ -19,7 -19,7 +19,7 @@@ import // Test that go1.2 tag above is included in builds. main.go refers to this definition. const go12tag = true --const APP_VER = "0.2.2.0408 Alpha" ++const APP_VER = "0.2.2.0409 Alpha" func init() { base.AppVer = APP_VER diff --cc models/oauth2.go index cde57b87b9,9a38334e64..45728b0d51 --- a/models/oauth2.go +++ b/models/oauth2.go @@@ -35,14 -31,18 +35,15 @@@ func AddOauth2(oa *Oauth2) (err error) } func GetOauth2(identity string) (oa *Oauth2, err error) { - oa = &Oauth2{} - oa.Identity = identity - exists, err := orm.Get(oa) + oa = &Oauth2{Identity: identity} + isExist, err := orm.Get(oa) if err != nil { return - } - if !exists { + } else if !isExist { return nil, ErrOauth2RecordNotExists - } - if oa.Uid == 0 { + } else if oa.Uid == 0 { return oa, ErrOauth2NotAssociatedWithUser } - return GetUserById(oa.Uid) + oa.User, err = GetUserById(oa.Uid) - return ++ return oa, err }