From 1d6233e5cac460e29f81bd7000b93f0f6e93b6bb Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Tue, 24 Oct 2017 16:56:23 -0400 Subject: [PATCH] Completely fix https://github.com/Phyks/Flatisfy/issues/10 --- flatisfy/fetch.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flatisfy/fetch.py b/flatisfy/fetch.py index f0a6c99..15f4186 100644 --- a/flatisfy/fetch.py +++ b/flatisfy/fetch.py @@ -128,6 +128,15 @@ class WeboobProxy(object): postal_code ) + # Remove "TOUTES COMMUNES" entry which are duplicates of the individual + # cities entries in Logicimmo module. + matching_cities = [ + city + for city in matching_cities + if not (city.backend == 'logicimmo' and + city.name.startswith('TOUTES COMMUNES')) + ] + # Then, build queries by grouping cities by at most 3 for cities_batch in tools.batch(matching_cities, 3): query = Query()