mirror of https://github.com/jumpserver/jumpserver
fix(perms): 用户搜索全部授权资产报错
parent
6701a1b604
commit
1d49b3deca
|
@ -102,11 +102,12 @@ class UserAllGrantedAssetsApi(ListAPIView):
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
queryset = get_user_granted_all_assets(self.user)
|
queryset = get_user_granted_all_assets(self.user)
|
||||||
|
queryset = queryset.prefetch_related('platform')
|
||||||
return queryset.only(*self.only_fields)
|
return queryset.only(*self.only_fields)
|
||||||
|
|
||||||
|
|
||||||
class MyAllAssetsAsTreeApi(ForUserMixin, AssetsAsTreeMixin, UserAllGrantedAssetsApi):
|
class MyAllAssetsAsTreeApi(ForUserMixin, AssetsAsTreeMixin, UserAllGrantedAssetsApi):
|
||||||
pass
|
search_fields = ['hostname', 'ip']
|
||||||
|
|
||||||
|
|
||||||
@method_decorator(tmp_to_root_org(), name='list')
|
@method_decorator(tmp_to_root_org(), name='list')
|
||||||
|
|
Loading…
Reference in New Issue