From faf888da3d38ac2cf81ece99ce4941c2786031b2 Mon Sep 17 00:00:00 2001 From: stoorx Date: Wed, 27 Aug 2025 16:58:44 +0300 Subject: [PATCH] feat: Make `USERNAME_MIN_LENGTH` customizable --- openedx/core/djangoapps/user_api/accounts/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/user_api/accounts/__init__.py b/openedx/core/djangoapps/user_api/accounts/__init__.py index caf78ca54a..faed01a6bb 100644 --- a/openedx/core/djangoapps/user_api/accounts/__init__.py +++ b/openedx/core/djangoapps/user_api/accounts/__init__.py @@ -14,7 +14,7 @@ NAME_MIN_LENGTH = 1 NAME_MAX_LENGTH = 255 # The minimum and maximum length for the username account field -USERNAME_MIN_LENGTH = 2 +USERNAME_MIN_LENGTH = getattr(settings, 'USERNAME_MIN_LENGTH', 2) # Note: 30 chars is the default for historical reasons. Django uses 150 as the username length since 1.10 USERNAME_MAX_LENGTH = getattr(settings, 'USERNAME_MAX_LENGTH', 30)