mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
parent
77d71f95a3
commit
7a08f036e9
|
|
@ -128,7 +128,7 @@ class RegisterSerializer(ApiMixin, serializers.Serializer):
|
|||
max_length=20,
|
||||
min_length=6,
|
||||
validators=[
|
||||
validators.RegexValidator(regex=re.compile("^[a-zA-Z][a-zA-Z1-9_]{5,20}$"),
|
||||
validators.RegexValidator(regex=re.compile("^[a-zA-Z][a-zA-Z0-9_]{5,20}$"),
|
||||
message="用户名字符数为 6-20 个字符,必须以字母开头,可使用字母、数字、下划线等")
|
||||
])
|
||||
password = serializers.CharField(required=True, error_messages=ErrMessage.char("密码"),
|
||||
|
|
@ -582,7 +582,7 @@ class UserManageSerializer(serializers.Serializer):
|
|||
max_length=20,
|
||||
min_length=6,
|
||||
validators=[
|
||||
validators.RegexValidator(regex=re.compile("^[a-zA-Z][a-zA-Z1-9_]{5,20}$"),
|
||||
validators.RegexValidator(regex=re.compile("^[a-zA-Z][a-zA-Z0-9_]{5,20}$"),
|
||||
message="用户名字符数为 6-20 个字符,必须以字母开头,可使用字母、数字、下划线等")
|
||||
])
|
||||
password = serializers.CharField(required=True, error_messages=ErrMessage.char("密码"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue