fix: 手机号可以为空及验证逻辑修改

This commit is contained in:
jiangweidong
2023-04-10 17:24:17 +08:00
committed by Jiangjie.Bai
parent b58488a7e9
commit 8ff1bae7e6
2 changed files with 9 additions and 3 deletions

View File

@@ -106,7 +106,7 @@ class UserSerializer(RolesSerializerMixin, CommonBulkSerializerMixin, serializer
allow_null=True, max_length=1024,
)
phone = PhoneField(
validators=[PhoneValidator()], required=False, allow_null=True, label=_("Phone")
validators=[PhoneValidator()], required=False, allow_blank=True, allow_null=True, label=_("Phone")
)
custom_m2m_fields = {
"system_roles": [BuiltinRole.system_user],