perf: 用户详情页-资产授权规则字段排序优化

pull/13052/head
wangruidong 2024-04-18 11:03:24 +08:00 committed by w940853815
parent e8d717d174
commit 29dbc2e4d4
1 changed files with 2 additions and 2 deletions

View File

@ -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):