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')