mirror of https://github.com/jumpserver/jumpserver
commit
851bd99eaf
|
@ -132,13 +132,12 @@ def on_asset_nodes_add(sender, instance=None, action='', model=None, pk_set=None
|
||||||
if action != "post_add":
|
if action != "post_add":
|
||||||
return
|
return
|
||||||
logger.debug("Assets node add signal recv: {}".format(action))
|
logger.debug("Assets node add signal recv: {}".format(action))
|
||||||
queryset = model.objects.filter(pk__in=pk_set).values_list('key', flat=True)
|
|
||||||
if model == Node:
|
if model == Node:
|
||||||
nodes = queryset
|
nodes = model.objects.filter(pk__in=pk_set).values_list('key', flat=True)
|
||||||
assets = [instance]
|
assets = [instance.id]
|
||||||
else:
|
else:
|
||||||
nodes = [instance]
|
nodes = [instance.key]
|
||||||
assets = queryset
|
assets = model.objects.filter(pk__in=pk_set).values_list('id', flat=True)
|
||||||
# 节点资产发生变化时,将资产关联到节点及祖先节点关联的系统用户, 只关注新增的
|
# 节点资产发生变化时,将资产关联到节点及祖先节点关联的系统用户, 只关注新增的
|
||||||
nodes_ancestors_keys = set()
|
nodes_ancestors_keys = set()
|
||||||
node_tree = TreeService.new()
|
node_tree = TreeService.new()
|
||||||
|
|
Loading…
Reference in New Issue