From fe502cbe4121256152e9c1511c5d57bfe563de98 Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 14 Sep 2020 11:38:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(assets):=20=E4=BF=AE=E5=A4=8D=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=94=A8=E6=88=B7=E5=AF=BC=E5=85=A5=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=AF=86=E7=A0=81=E5=AD=97=E6=AE=B5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/serializers/system_user.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/assets/serializers/system_user.py b/apps/assets/serializers/system_user.py index 0fcff5b1d..c412641da 100644 --- a/apps/assets/serializers/system_user.py +++ b/apps/assets/serializers/system_user.py @@ -149,6 +149,7 @@ class SystemUserListSerializer(SystemUserSerializer): class Meta(SystemUserSerializer.Meta): fields = [ 'id', 'name', 'username', 'protocol', + 'password', 'public_key', 'private_key', 'login_mode', 'login_mode_display', 'priority', "username_same_with_user", 'auto_push', 'sudo', 'shell', 'comment', @@ -157,6 +158,12 @@ class SystemUserListSerializer(SystemUserSerializer): 'sftp_root', ] + extra_kwargs = { + 'password': {"write_only": True}, + 'public_key': {"write_only": True}, + 'private_key': {"write_only": True}, + } + @classmethod def setup_eager_loading(cls, queryset): """ Perform necessary eager loading of data. """