PLT-5943 Reduce minimum username length (#5798)

This commit is contained in:
Joram Wilander
2017-03-17 16:42:23 +00:00
committed by George Goldberg
parent 91d430b2a3
commit f4473cf312
3 changed files with 3 additions and 5 deletions
-3
View File
@@ -160,9 +160,6 @@ func TestGetUserByUsername(t *testing.T) {
_, resp = Client.GetUserByUsername(GenerateTestUsername(), "")
CheckNotFoundStatus(t, resp)
_, resp = Client.GetUserByUsername(model.NewRandomString(1), "")
CheckBadRequestStatus(t, resp)
// Check against privacy config settings
emailPrivacy := utils.Cfg.PrivacySettings.ShowEmailAddress
namePrivacy := utils.Cfg.PrivacySettings.ShowFullName
+1 -1
View File
@@ -36,7 +36,7 @@ const (
USER_LAST_NAME_MAX_RUNES = 64
USER_AUTH_DATA_MAX_LENGTH = 128
USER_NAME_MAX_LENGTH = 64
USER_NAME_MIN_LENGTH = 3
USER_NAME_MIN_LENGTH = 1
)
type User struct {
+2 -1
View File
@@ -189,7 +189,8 @@ var usernames = []struct {
expected bool
}{
{"spin-punch", true},
{"sp", false},
{"sp", true},
{"s", true},
{"1spin-punch", false},
{"-spin-punch", false},
{".spin-punch", false},