From caa49616790ba5c457a15e20cc16b818953b7c81 Mon Sep 17 00:00:00 2001 From: Gautier P Date: Mon, 18 Jan 2021 11:21:22 +0100 Subject: [PATCH] Set housing.id only after retrieving phone if needed --- flatisfy/fetch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flatisfy/fetch.py b/flatisfy/fetch.py index 325e092..66d8091 100644 --- a/flatisfy/fetch.py +++ b/flatisfy/fetch.py @@ -235,14 +235,14 @@ class WebOOBProxy(object): try: housing = backend.get_housing(flat_id) - # Otherwise, we miss the @backend afterwards - housing.id = full_flat_id if not store_personal_data: # Ensure phone is cleared housing.phone = None else: # Ensure phone is fetched backend.fillobj(housing, 'phone') + # Otherwise, we miss the @backend afterwards + housing.id = full_flat_id return json.dumps(housing, cls=WeboobEncoder) except Exception as exc: # pylint: disable=broad-except