diff options
author | Unknwon <u@gogs.io> | 2015-08-08 22:43:14 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-08 22:43:14 +0800 |
commit | dea3a8c6a42ea7e4921c0e4beee5d4fd0437dbe5 (patch) | |
tree | 773b28a72cee24e4a02f3d162de8a37a8f912f59 /models/user.go | |
parent | d015d951bd6959f9585d8a83acfe7bba07b7eaad (diff) | |
download | gitea-dea3a8c6a42ea7e4921c0e4beee5d4fd0437dbe5.tar.gz gitea-dea3a8c6a42ea7e4921c0e4beee5d4fd0437dbe5.zip |
WIP: create PR - choose branch
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/models/user.go b/models/user.go index 6dd31536fb..3100a45ade 100644 --- a/models/user.go +++ b/models/user.go @@ -226,7 +226,7 @@ func (u *User) GetOrganizations() error { u.Orgs = make([]*User, len(ous)) for i, ou := range ous { - u.Orgs[i], err = GetUserById(ou.OrgID) + u.Orgs[i], err = GetUserByID(ou.OrgID) if err != nil { return err } @@ -555,7 +555,7 @@ func GetUserByKeyId(keyId int64) (*User, error) { return user, nil } -func getUserById(e Engine, id int64) (*User, error) { +func getUserByID(e Engine, id int64) (*User, error) { u := new(User) has, err := e.Id(id).Get(u) if err != nil { @@ -566,9 +566,9 @@ func getUserById(e Engine, id int64) (*User, error) { return u, nil } -// GetUserById returns the user object by given ID if exists. -func GetUserById(id int64) (*User, error) { - return getUserById(x, id) +// GetUserByID returns the user object by given ID if exists. +func GetUserByID(id int64) (*User, error) { + return getUserByID(x, id) } // GetUserByName returns user by given name. @@ -620,7 +620,7 @@ func GetEmailAddresses(uid int64) ([]*EmailAddress, error) { return nil, err } - u, err := GetUserById(uid) + u, err := GetUserByID(uid) if err != nil { return nil, err } @@ -666,7 +666,7 @@ func (email *EmailAddress) Activate() error { return err } - if user, err := GetUserById(email.Uid); err != nil { + if user, err := GetUserByID(email.Uid); err != nil { return err } else { user.Rands = GetUserSalt() @@ -793,7 +793,7 @@ func GetUserByEmail(email string) (*User, error) { return nil, err } if has { - return GetUserById(emailAddress.Uid) + return GetUserByID(emailAddress.Uid) } return nil, ErrUserNotExist{0, "email"} |