diff --git a/api4/user_test.go b/api4/user_test.go index c03169c727..155758d357 100644 --- a/api4/user_test.go +++ b/api4/user_test.go @@ -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 diff --git a/model/user.go b/model/user.go index f380a7550f..d62ccccd18 100644 --- a/model/user.go +++ b/model/user.go @@ -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 { diff --git a/model/user_test.go b/model/user_test.go index 542d15e5dd..47ec38dbf2 100644 --- a/model/user_test.go +++ b/model/user_test.go @@ -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},