From 29dbc2e4d42500268a3db12ceae7c3ef225de37d Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Thu, 18 Apr 2024 11:03:24 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=94=A8=E6=88=B7=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5-=E8=B5=84=E4=BA=A7=E6=8E=88=E6=9D=83=E8=A7=84?= =?UTF-8?q?=E5=88=99=E5=AD=97=E6=AE=B5=E6=8E=92=E5=BA=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/perms/serializers/permission.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/perms/serializers/permission.py b/apps/perms/serializers/permission.py index 35d6ecacd..74a7fac26 100644 --- a/apps/perms/serializers/permission.py +++ b/apps/perms/serializers/permission.py @@ -190,8 +190,8 @@ class AssetPermissionListSerializer(AssetPermissionSerializer): class Meta(AssetPermissionSerializer.Meta): amount_fields = ["users_amount", "user_groups_amount", "assets_amount", "nodes_amount"] - remove_fields = {"users", "assets", "nodes", "user_groups"} - fields = list(set(AssetPermissionSerializer.Meta.fields + amount_fields) - remove_fields) + fields = [item for item in (AssetPermissionSerializer.Meta.fields + amount_fields) if + item not in ["users", "assets", "nodes", "user_groups"]] @classmethod def setup_eager_loading(cls, queryset):