mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-24 16:05:00 +08:00
PLT-5943 Reduce minimum username length (#5798)
This commit is contained in:
committed by
George Goldberg
parent
91d430b2a3
commit
f4473cf312
@@ -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
@@ -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
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user