From 1d49b3deca2ada144e3e0d739994f935ea2cbcd7 Mon Sep 17 00:00:00 2001 From: xinwen Date: Mon, 28 Sep 2020 13:06:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(perms):=20=E7=94=A8=E6=88=B7=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=85=A8=E9=83=A8=E6=8E=88=E6=9D=83=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/perms/api/user_permission/user_permission_assets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/perms/api/user_permission/user_permission_assets.py b/apps/perms/api/user_permission/user_permission_assets.py index 3cb211434..08078094c 100644 --- a/apps/perms/api/user_permission/user_permission_assets.py +++ b/apps/perms/api/user_permission/user_permission_assets.py @@ -102,11 +102,12 @@ class UserAllGrantedAssetsApi(ListAPIView): def get_queryset(self): queryset = get_user_granted_all_assets(self.user) + queryset = queryset.prefetch_related('platform') return queryset.only(*self.only_fields) class MyAllAssetsAsTreeApi(ForUserMixin, AssetsAsTreeMixin, UserAllGrantedAssetsApi): - pass + search_fields = ['hostname', 'ip'] @method_decorator(tmp_to_root_org(), name='list')