From b6eac5a6b7f1794137a0d85f7d39d853756dfb58 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Fri, 20 Jan 2023 17:52:51 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/api/applet/applet.py | 1 + apps/terminal/serializers/applet.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/terminal/api/applet/applet.py b/apps/terminal/api/applet/applet.py index 3b85ab753..c2b361ca6 100644 --- a/apps/terminal/api/applet/applet.py +++ b/apps/terminal/api/applet/applet.py @@ -87,6 +87,7 @@ class DownloadUploadMixin: class AppletViewSet(DownloadUploadMixin, JMSBulkModelViewSet): queryset = Applet.objects.all() serializer_class = serializers.AppletSerializer + search_fields = ['name', 'display_name', 'author'] rbac_perms = { 'upload': 'terminal.add_applet', 'download': 'terminal.view_applet', diff --git a/apps/terminal/serializers/applet.py b/apps/terminal/serializers/applet.py index 89fdf19b5..64ae6eda2 100644 --- a/apps/terminal/serializers/applet.py +++ b/apps/terminal/serializers/applet.py @@ -29,7 +29,7 @@ class AppletSerializer(serializers.ModelSerializer): class Meta: model = Applet - fields_mini = ['id', 'name', 'display_name'] + fields_mini = ['id', 'name', 'display_name', 'is_active'] read_only_fields = [ 'icon', 'date_created', 'date_updated', ]