forked from gitea/gitea
1
0
Fork 0

Allow 1 letter usernames

This commit is contained in:
Unknown 2014-03-13 16:21:16 -04:00
parent c01f593daa
commit 52de63e7bb
3 changed files with 3 additions and 4 deletions

View File

@ -23,7 +23,7 @@ type Form interface {
}
type RegisterForm struct {
UserName string `form:"username" binding:"Required;AlphaDash;MinSize(5);MaxSize(30)"`
UserName string `form:"username" binding:"Required;AlphaDash;MaxSize(30)"`
Email string `form:"email" binding:"Required;Email;MaxSize(50)"`
Password string `form:"passwd" binding:"Required;MinSize(6);MaxSize(30)"`
RetypePasswd string `form:"retypepasswd"`
@ -59,7 +59,7 @@ func (f *RegisterForm) Validate(errors *binding.Errors, req *http.Request, conte
}
type LogInForm struct {
UserName string `form:"username" binding:"Required;AlphaDash;MinSize(5);MaxSize(30)"`
UserName string `form:"username" binding:"Required;AlphaDash;MaxSize(30)"`
Password string `form:"passwd" binding:"Required;MinSize(6);MaxSize(30)"`
}

View File

@ -78,7 +78,6 @@ function initRegister() {
rules: {
"username": {
required: true,
minlength: 5,
maxlength: 30
},
"email": {

View File

@ -7,7 +7,7 @@
<div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
<label class="col-md-4 control-label">Username: </label>
<div class="col-md-6">
<input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required" title="Username must contain at least 5 characters">
<input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required">
</div>
</div>