Filter offer edges from route stages
All checks were successful
Build Docker Image / build (push) Successful in 1m42s
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user