Skip to content

Commit

Permalink
fix: ci_type find_path _graph
Browse files Browse the repository at this point in the history
  • Loading branch information
simontigers authored Dec 18, 2024
1 parent 510ea5d commit 082724e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmdb-api/api/lib/cmdb/ci_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,13 +862,13 @@ def find_path(source_type_id, target_type_ids):

graph = nx.DiGraph()

def get_children(_id, graph):
def get_children(_id, _graph):
children = CITypeRelation.get_by(parent_id=_id, to_dict=False)

for i in children:
if i.child_id != _id:
graph.add_edge(i.parent_id, i.child_id)
get_children(i.child_id)
_graph.add_edge(i.parent_id, i.child_id)
get_children(i.child_id, _graph)

get_children(source_type_id, graph)

Expand Down

0 comments on commit 082724e

Please sign in to comment.