summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api4/user_test.go3
-rw-r--r--model/user.go2
-rw-r--r--model/user_test.go3
3 files changed, 3 insertions, 5 deletions
diff --git a/api4/user_test.go b/api4/user_test.go
index c03169c72..155758d35 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 f380a7550..d62ccccd1 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 542d15e5d..47ec38dbf 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},