fix: 修复资产授权规则过滤

pull/9702/head
Bai 2 years ago committed by Jiangjie.Bai
parent ad0fc0d70a
commit 49c7a12bb3

@ -95,6 +95,7 @@ class AssetPermissionFilter(PermissionBaseFilter):
node_name = filters.CharFilter(method='do_nothing')
asset_id = filters.UUIDFilter(method='do_nothing')
asset_name = filters.CharFilter(method='do_nothing')
address = filters.CharFilter(method='do_nothing')
accounts = filters.CharFilter(method='do_nothing')
ip = filters.CharFilter(method='do_nothing')
@ -153,14 +154,14 @@ class AssetPermissionFilter(PermissionBaseFilter):
is_query_all = self.get_query_param('all', True)
asset_id = self.get_query_param('asset_id')
asset_name = self.get_query_param('asset_name')
ip = self.get_query_param('address')
address = self.get_query_param('address')
if asset_id:
assets = Asset.objects.filter(pk=asset_id)
elif asset_name:
assets = Asset.objects.filter(name=asset_name)
elif ip:
assets = Asset.objects.filter(ip=ip)
elif address:
assets = Asset.objects.filter(address=address)
else:
return queryset
if not assets:

Loading…
Cancel
Save