summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-04 18:31:09 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-04 18:31:09 -0400
commiteb803ec5eb3a7e66a107873ce6ee584b8c77b131 (patch)
tree7980b8e04af31123708cf8baa9304fc7df596b3c /models/user.go
parentca5dcea7d15d3564425afbcb65dbea6ab859526f (diff)
downloadgitea-eb803ec5eb3a7e66a107873ce6ee584b8c77b131.tar.gz
gitea-eb803ec5eb3a7e66a107873ce6ee584b8c77b131.zip
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 c5e46b4804..2641a15ff2 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})
}