From 7fc2ef00eee69f323e540916d69b975bac0cc6f5 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 11 Apr 2018 12:45:04 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E8=B5=84=E4=BA=A7?= =?UTF-8?q?api=E8=8E=B7=E5=8F=96=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/api/asset.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/assets/api/asset.py b/apps/assets/api/asset.py index 9520ff120..50c037df9 100644 --- a/apps/assets/api/asset.py +++ b/apps/assets/api/asset.py @@ -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