fix: update username regex validation to allow any characters within length constraints

This commit is contained in:
wxg0103 2025-10-24 11:07:30 +08:00
parent 609667d9d3
commit 47c27e58f7

View File

@ -143,7 +143,7 @@ class UserManageSerializer(serializers.Serializer):
min_length=4,
validators=[
validators.RegexValidator(
regex=re.compile("^[^\u4e00-\u9fa5]{4,20}$"),
regex=re.compile("^.{4,20}$"),
message=_('Username must be 4-20 characters long')
)
]