From 082d177f199edced10e6914c002cc572b8d9d24d Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Mon, 19 Jun 2017 17:14:18 +0200 Subject: [PATCH] More informative error message when matching accidentally a wrong postal code. See #64 for more context. --- flatisfy/filters/metadata.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/flatisfy/filters/metadata.py b/flatisfy/filters/metadata.py index ce0063f..9aa67e4 100644 --- a/flatisfy/filters/metadata.py +++ b/flatisfy/filters/metadata.py @@ -212,9 +212,14 @@ def guess_postal_code(flats_list, constraint, config, distance_threshold=20000): if distance > distance_threshold: LOGGER.info( - ("Postal code %s found for flat %s is off-constraints. " - "Min distance is %f."), - postal_code, flat["id"], distance + ("Postal code %s found for flat %s is off-constraints " + "(distance is %dm > %dm). Let's consider it is an " + "artifact match and keep the post without this postal " + "code."), + postal_code, + flat["id"], + int(distance), + int(distance_threshold) ) postal_code = None