Merge pull request #2582 from jumpserver/dev_bugfix_assets

[Bugfix] 修复资产对象获取所有节点时的bug
pull/2583/head
老广 6 years ago committed by GitHub
commit 638ba31694
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -153,7 +153,7 @@ class Asset(OrgModelMixin):
nodes = [] nodes = []
for node in self.get_nodes(): for node in self.get_nodes():
_nodes = node.get_ancestor(with_self=True) _nodes = node.get_ancestor(with_self=True)
_nodes.append(_nodes) nodes.append(_nodes)
if flat: if flat:
nodes = list(reduce(lambda x, y: set(x) | set(y), nodes)) nodes = list(reduce(lambda x, y: set(x) | set(y), nodes))
return nodes return nodes

Loading…
Cancel
Save