fix(perms): 用户搜索全部授权资产报错

pull/4716/head
xinwen 4 years ago committed by 老广
parent 6701a1b604
commit 1d49b3deca

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

Loading…
Cancel
Save