diff options
author | Unknwon <u@gogs.io> | 2015-08-05 20:26:00 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-05 20:26:00 +0800 |
commit | 2c507667bfd17f88dc4bfabc426c74cd5f8e4461 (patch) | |
tree | 31b267331f84d45a92f6a0bfe7eaafa124f4578f /modules/auth | |
parent | 0705f55ce097b9892a7c4c11faa5396c4e557232 (diff) | |
parent | b9527cd1bfabcce3be62b43f0c199b1418519549 (diff) |
Merge branch 'develop' of github.com:gogits/gogs into feature/milestone
# Conflicts:
# gogs.go
# models/issue.go
# templates/.VERSION
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/auth.go | 6 | ||||
-rw-r--r-- | modules/auth/org.go | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go index 155a8272..7e01abc3 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -55,7 +55,7 @@ func SignedInId(req *http.Request, sess session.Store) int64 { } if id, ok := uid.(int64); ok { if _, err := models.GetUserById(id); err != nil { - if err != models.ErrUserNotExist { + if !models.IsErrUserNotExist(err) { log.Error(4, "GetUserById: %v", err) } return 0 @@ -80,7 +80,7 @@ func SignedInUser(req *http.Request, sess session.Store) (*models.User, bool) { if len(webAuthUser) > 0 { u, err := models.GetUserByName(webAuthUser) if err != nil { - if err != models.ErrUserNotExist { + if !models.IsErrUserNotExist(err) { log.Error(4, "GetUserByName: %v", err) return nil, false } @@ -115,7 +115,7 @@ func SignedInUser(req *http.Request, sess session.Store) (*models.User, bool) { u, err := models.UserSignIn(uname, passwd) if err != nil { - if err != models.ErrUserNotExist { + if !models.IsErrUserNotExist(err) { log.Error(4, "UserSignIn: %v", err) } return nil, false diff --git a/modules/auth/org.go b/modules/auth/org.go index 3e6c55c1..0dfab951 100644 --- a/modules/auth/org.go +++ b/modules/auth/org.go @@ -26,7 +26,7 @@ func (f *CreateOrgForm) Validate(ctx *macaron.Context, errs binding.Errors) bind } type UpdateOrgSettingForm struct { - OrgUserName string `form:"uname" binding:"Required;MaxSize(35)"` + OrgUserName string `form:"uname" binding:"Required;AlphaDashDot;MaxSize(30)" locale:"org.org_name_holder"` OrgFullName string `form:"fullname" binding:"MaxSize(100)"` Email string `form:"email" binding:"Required;Email;MaxSize(50)"` Description string `form:"desc" binding:"MaxSize(255)"` |