From efa872479dfd955205b42e0e65967b63ab11a8da Mon Sep 17 00:00:00 2001 From: Sverre Nystad Date: Sat, 10 Aug 2024 23:36:38 +0200 Subject: [PATCH] fix: update pathfinder_status logic in post_graph_traversal --- backend/graphtraversal/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/graphtraversal/views.py b/backend/graphtraversal/views.py index 7525f24..8203154 100644 --- a/backend/graphtraversal/views.py +++ b/backend/graphtraversal/views.py @@ -109,7 +109,7 @@ def post_graph_traversal(request): time_taken = datetime.now().timestamp() - current_time print(f"path: {path}") print(f"node_order: {node_order}") - pathfinder_status: str = "success" if path is not None else "failure" + pathfinder_status: str = "success" if len(path) == 0 else "failure" # Serialize the list of dictionaries to a JSON string path_dicts = [node.to_dict() for node in path]