aboutsummaryrefslogtreecommitdiff
path: root/models/user.go
diff options
context:
space:
mode:
author无闻 <joe2010xtmf@163.com>2014-04-04 18:39:21 -0400
committer无闻 <joe2010xtmf@163.com>2014-04-04 18:39:21 -0400
commitef6b9784962d3152d3ec46833303bad72915af57 (patch)
tree7980b8e04af31123708cf8baa9304fc7df596b3c /models/user.go
parent3a23476dbef0bb90ce5e8bc4c7ab8929bc04bb1b (diff)
parenteb803ec5eb3a7e66a107873ce6ee584b8c77b131 (diff)
Merge pull request #62 from gogits/dev
Add transfer repository
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index c5e46b48..2641a15f 100644
--- a/models/user.go
+++ b/models/user.go
@@ -105,11 +105,17 @@ type Member struct {
// IsUserExist checks if given user name exist,
// the user name should be noncased unique.
func IsUserExist(name string) (bool, error) {
+ if len(name) == 0 {
+ return false, nil
+ }
return orm.Get(&User{LowerName: strings.ToLower(name)})
}
// IsEmailUsed returns true if the e-mail has been used.
func IsEmailUsed(email string) (bool, error) {
+ if len(email) == 0 {
+ return false, nil
+ }
return orm.Get(&User{Email: email})
}