Unverified Commit 6330f2d4 authored by 老广's avatar 老广 Committed by GitHub

[Update] 修改获取禁用资产的问题 (#2901)

parent 033b44f9
...@@ -493,7 +493,7 @@ class AssetPermissionUtil(AssetPermissionCacheMixin): ...@@ -493,7 +493,7 @@ class AssetPermissionUtil(AssetPermissionCacheMixin):
pattern.add(r'^{0}$|^{0}:'.format(node.key)) pattern.add(r'^{0}$|^{0}:'.format(node.key))
pattern = '|'.join(list(pattern)) pattern = '|'.join(list(pattern))
if pattern: if pattern:
assets = Asset.objects.filter(nodes__key__regex=pattern) \ assets = Asset.objects.filter(nodes__key__regex=pattern).valid() \
.prefetch_related('nodes')\ .prefetch_related('nodes')\
.only(*self.assets_only)\ .only(*self.assets_only)\
.distinct() .distinct()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment