feat: Make USERNAME_MIN_LENGTH customizable

This commit is contained in:
stoorx
2025-08-27 16:58:44 +03:00
committed by Stoorx
parent 1a081f23c0
commit faf888da3d

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)