Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit f3b012b

Browse files
committed
Correctly manage the edge case of an empty string
As ''.isspace() == False o_O the former expression would evaluate as True.
1 parent da9ef5d commit f3b012b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

labonneboite/common/models/office.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ def address_as_text(self):
236236

237237
@property
238238
def phone(self):
239-
# FIXME ''.isspace() == False o_O
240-
has_phone = self.tel and not self.tel.isspace()
239+
has_phone = self.tel and self.tel.strip()
241240
if has_phone:
242241
# not sure why, the import botched the phone number...
243242
if self.tel[-2] == '.':

0 commit comments

Comments
 (0)