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

Commit

Permalink
Correctly manage the edge case of an empty string
Browse files Browse the repository at this point in the history
As ''.isspace() == False o_O the former expression would
evaluate as True.
  • Loading branch information
dejafait committed Jan 11, 2019
1 parent 494e6e4 commit 33c9fd6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions labonneboite/common/models/office.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] == '.':
Expand Down

0 comments on commit 33c9fd6

Please sign in to comment.