From 33c9fd6c924a25f1deae1ed3f9d2b8d2b29a73ab Mon Sep 17 00:00:00 2001 From: Vermeer GRANGE Date: Wed, 2 Jan 2019 11:25:15 +0100 Subject: [PATCH] Correctly manage the edge case of an empty string As ''.isspace() == False o_O the former expression would evaluate as True. --- labonneboite/common/models/office.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/labonneboite/common/models/office.py b/labonneboite/common/models/office.py index ead81582b..665c06708 100644 --- a/labonneboite/common/models/office.py +++ b/labonneboite/common/models/office.py @@ -236,8 +236,7 @@ def address_as_text(self): @property def phone(self): - # FIXME ''.isspace() == False o_O - has_phone = self.tel and not self.tel.isspace() + has_phone = self.tel and self.tel.strip() if has_phone: # not sure why, the import botched the phone number... if self.tel[-2] == '.':