From 332393a4fc50ee77395ae9709aaadf8bc299df65 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 21 May 2024 10:49:10 +0100 Subject: [PATCH] updated extract_kwargs to handle empty string --- .idea/Model.iml | 2 +- .idea/misc.xml | 2 +- backend/Property.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.idea/Model.iml b/.idea/Model.iml index b0f9c00d..4413bb06 100644 --- a/.idea/Model.iml +++ b/.idea/Model.iml @@ -7,7 +7,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 1122b380..6f308057 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,7 +3,7 @@ - + diff --git a/backend/Property.py b/backend/Property.py index 3cb8969a..a5918802 100644 --- a/backend/Property.py +++ b/backend/Property.py @@ -172,12 +172,12 @@ class Property: :return: """ n_bathrooms = kwargs.get("n_bathrooms", None) - if n_bathrooms is not None: + if n_bathrooms not in [None, ""]: # We add on a small value to ensure that the number of bathrooms is rounded up, in case the value is 0.5 n_bathrooms = int(round(float(n_bathrooms) + 1e-5)) n_bedrooms = kwargs.get("n_bedrooms", None) - if n_bedrooms is not None: + if n_bedrooms not in [None, ""]: n_bedrooms = int(round(float(n_bedrooms) + 1e-5)) return {