summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2015-02-13 00:58:46 -0500
committerUnknwon <joe2010xtmf@163.com>2015-02-13 00:58:46 -0500
commit6d0f3a07d4fa3189b0b7c4e366bddb6d72ef7e68 (patch)
tree02b1617a75095fe5f072533708e920fbac477d34 /models/user.go
parentb99c4baab22ec080906582703809e5ec12bae3f9 (diff)
downloadgitea-6d0f3a07d4fa3189b0b7c4e366bddb6d72ef7e68.tar.gz
gitea-6d0f3a07d4fa3189b0b7c4e366bddb6d72ef7e68.zip
code fix #941 caution: undertest
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/models/user.go b/models/user.go
index 7e3dc260e5..37e77dd3ba 100644
--- a/models/user.go
+++ b/models/user.go
@@ -521,10 +521,9 @@ func GetUserByKeyId(keyId int64) (*User, error) {
return user, nil
}
-// GetUserById returns the user object by given ID if exists.
-func GetUserById(id int64) (*User, error) {
+func getUserById(e Engine, id int64) (*User, error) {
u := new(User)
- has, err := x.Id(id).Get(u)
+ has, err := e.Id(id).Get(u)
if err != nil {
return nil, err
} else if !has {
@@ -533,6 +532,11 @@ func GetUserById(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)
+}
+
// GetUserByName returns user by given name.
func GetUserByName(name string) (*User, error) {
if len(name) == 0 {