Skip to content

Commit

Permalink
enable dot(.) in usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrydzewski committed Oct 5, 2017
1 parent 8125f97 commit 3529dda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion model/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// validate a username (e.g. from github)
var reUsername = regexp.MustCompile("^[a-zA-Z0-9-_]+$")
var reUsername = regexp.MustCompile("^[a-zA-Z0-9-_.]+$")

var errUserLoginInvalid = errors.New("Invalid User Login")

Expand Down
4 changes: 4 additions & 0 deletions model/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func TestUserValidate(t *testing.T) {
user: User{Login: "john_smith"},
err: nil,
},
{
user: User{Login: "john.smith"},
err: nil,
},
}

for _, test := range tests {
Expand Down

0 comments on commit 3529dda

Please sign in to comment.