From 94ae2730edbff755b2c269cfb157c234cbd2d744 Mon Sep 17 00:00:00 2001 From: Antoine Goutenoir Date: Sun, 27 Oct 2019 00:02:32 +0200 Subject: [PATCH] Ignore duplicates in destinations. --- flaskr/controllers/main_controller.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flaskr/controllers/main_controller.py b/flaskr/controllers/main_controller.py index 7c1161e..1e6da5a 100644 --- a/flaskr/controllers/main_controller.py +++ b/flaskr/controllers/main_controller.py @@ -301,7 +301,8 @@ def compute(): # process the queue of estimation requests 'cities': cities_mean } - _results['total'] = total + _results['total'] = total # DEPRECATED + _results['footprint'] = total return _results @@ -333,10 +334,16 @@ def compute(): # process the queue of estimation requests # Run Scenario A for each Destination, and expose optimum Destination. # else: + unique_city_keys = [] result_cities = [] for destination in destinations: city_key = get_city_key(destination) + if city_key in unique_city_keys: + continue + else: + unique_city_keys.append(city_key) + city_results = compute_one_to_many( _origin=destination, _destinations=origins, -- libgit2 0.21.2