diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-10-24 18:43:17 -0400 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-10-24 18:43:17 -0400 |
commit | f1d87462642aa0ab4ce61e8a285e3a288b4dc119 (patch) | |
tree | ebebe7ec77b9f4f8b0a38fa3b92cd49662244cca /models/user.go | |
parent | baae94b9cfe716eb85a56ea0bf3528af29413c6e (diff) | |
download | gitea-f1d87462642aa0ab4ce61e8a285e3a288b4dc119.tar.gz gitea-f1d87462642aa0ab4ce61e8a285e3a288b4dc119.zip |
Fix fork repo and macaron API broken
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/models/user.go b/models/user.go index dc9b052ca8..6b0f796b56 100644 --- a/models/user.go +++ b/models/user.go @@ -193,7 +193,7 @@ func IsEmailUsed(email string) (bool, error) { return x.Get(&User{Email: email}) } -// GetUserSalt returns a user salt token +// GetUserSalt returns a ramdom user salt token. func GetUserSalt() string { return base.GetRandomString(10) } @@ -473,19 +473,19 @@ func GetUserById(id int64) (*User, error) { return u, nil } -// GetUserByName returns the user object by given name if exists. +// GetUserByName returns user by given name. func GetUserByName(name string) (*User, error) { if len(name) == 0 { return nil, ErrUserNotExist } - user := &User{LowerName: strings.ToLower(name)} - has, err := x.Get(user) + u := &User{LowerName: strings.ToLower(name)} + has, err := x.Get(u) if err != nil { return nil, err } else if !has { return nil, ErrUserNotExist } - return user, nil + return u, nil } // GetUserEmailsByNames returns a list of e-mails corresponds to names. |