From bc8df726034f5197396a7b83b8f85a32bfb9e8cb Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Wed, 11 May 2022 15:57:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E7=9A=84=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/serializers/user.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/users/serializers/user.py b/apps/users/serializers/user.py index 5a1043267..b1a9cf1d4 100644 --- a/apps/users/serializers/user.py +++ b/apps/users/serializers/user.py @@ -7,6 +7,7 @@ from rest_framework import serializers from common.mixins import CommonBulkSerializerMixin from common.validators import PhoneValidator from common.utils import pretty_string +from common.drf.fields import EncryptedField from rbac.builtin import BuiltinRole from rbac.permissions import RBACPermission from rbac.models import OrgRoleBinding, SystemRoleBinding, Role @@ -87,6 +88,7 @@ class UserSerializer(RolesSerializerMixin, CommonBulkSerializerMixin, serializer can_public_key_auth = serializers.ReadOnlyField( source='can_use_ssh_key_login', label=_('Can public key authentication') ) + password = EncryptedField(required=False, allow_blank=True, allow_null=True, max_length=1024) # Todo: 这里看看该怎么搞 # can_update = serializers.SerializerMethodField(label=_('Can update')) # can_delete = serializers.SerializerMethodField(label=_('Can delete'))