Filter offer edges from route stages
All checks were successful
Build Docker Image / build (push) Successful in 1m42s

Offer edges connect offer nodes to locations and are not
transport stages. Filter them out in _build_route_from_edges()
to avoid showing 0km "offer" steps in the route stepper.
This commit is contained in:
Ruslan Bakiev
2026-01-15 00:32:41 +07:00
parent 0330203a58
commit fd7e10c193

View File

@@ -795,6 +795,11 @@ def _build_route_from_edges(path_edges, node_docs):
if not path_edges: if not path_edges:
return None return None
# Фильтруем offer edges - это не транспортные этапы, а связь оффера с локацией
path_edges = [(f, t, e) for f, t, e in path_edges if e.get('transport_type') != 'offer']
if not path_edges:
return None
stages = [] stages = []
current_edges = [] current_edges = []
current_type = None current_type = None