From 473a66719b0c1aa3f4929f0ea9e5fa38fbca12c5 Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Mon, 26 Jul 2021 19:19:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=88=E7=AB=AF=20=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E6=95=B0=E6=8D=AE=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/serializers/terminal.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/terminal/serializers/terminal.py b/apps/terminal/serializers/terminal.py index 5f813845f..6f00c309a 100644 --- a/apps/terminal/serializers/terminal.py +++ b/apps/terminal/serializers/terminal.py @@ -18,7 +18,7 @@ class StatusSerializer(serializers.ModelSerializer): class Meta: fields_mini = ['id'] - fields_write_only = ['sessions',] + fields_write_only = ['sessions', ] fields_small = fields_mini + fields_write_only + [ 'cpu_load', 'memory_used', 'disk_used', 'session_online', @@ -55,6 +55,11 @@ class TerminalSerializer(BulkModelSerializer): fields = fields_small + fields_fk read_only_fields = ['type', 'date_created'] + extra_kwargs = { + 'command_storage': {'required': True, }, + 'replay_storage': {'required': True, }, + } + @staticmethod def get_kwargs_may_be_uuid(value): kwargs = {}