[Update] 修改资产api获取的bug

pull/1185/head
ibuler 2018-04-11 12:45:04 +08:00
parent cbd6c3ee69
commit 7fc2ef00ee
1 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,9 @@ class AssetViewSet(IDInFilterMixin, LabelFilter, BulkModelViewSet):
if node_id:
node = get_object_or_404(Node, id=node_id)
if not node.is_root():
queryset = queryset.filter(nodes__key__startswith=node.key).distinct()
queryset = queryset.filter(
nodes__key__regex='{}(:[0-9]+)*$'.format(node.key),
).distinct()
return queryset