refactor: Fix bug in Vertex class when checking if param is a list

Update the Vertex class in base.py to fix a bug in the logic for checking if a parameter is a list. The current implementation only checks if the "list" key exists in the template_dict, but it should also check if the value of the "list" key is truthy. This change ensures that the correct condition is used to determine if a parameter is a list, preventing potential overwriting of params with the same name but different target_id.
This commit is contained in:
ogabrielluiz 2024-06-13 00:04:24 -03:00
commit bb847db2b8

View file

@ -302,7 +302,7 @@ class Vertex:
# We check this to make sure params with the same name but different target_id
# don't get overwritten
if param_key in template_dict and edge.target_id == self.id:
if template_dict[param_key]["list"]:
if template_dict[param_key].get("list"):
if param_key not in params:
params[param_key] = []
params[param_key].append(self.graph.get_vertex(edge.source_id))