From 7a08f036e960589c1af0343153af3689d4ab5ffd Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 7 May 2024 13:54:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=9B=E5=BB=BA=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=97=B6=E7=94=A8=E6=88=B7=E5=90=8D=E5=90=AB=E6=9C=89?= =?UTF-8?q?=200=20=E6=97=B6=E6=A0=A1=E9=AA=8C=E4=B8=8D=E9=80=9A=E8=BF=87?= =?UTF-8?q?=20#358=20(#375)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/serializers/user_serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/users/serializers/user_serializers.py b/apps/users/serializers/user_serializers.py index 352bf6f96..2d0da7f56 100644 --- a/apps/users/serializers/user_serializers.py +++ b/apps/users/serializers/user_serializers.py @@ -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("密码"),