Merge pull request #37289 from Stoorx/customizable-username-min-length

feat: Make `USERNAME_MIN_LENGTH` customizable
This commit is contained in:
Feanil Patel
2025-11-19 15:34:04 -05:00
committed by GitHub

View File

@@ -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)