From 7dc28a0d3e063f1fa650f96437305f04172e4f68 Mon Sep 17 00:00:00 2001 From: Romain Courteaud <romain@nexedi.com> Date: Mon, 18 Sep 2006 09:46:08 +0000 Subject: [PATCH] Use accessors to get properties. Test None value with the 'is' keyword. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10080 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/Telephone.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/product/ERP5/Document/Telephone.py b/product/ERP5/Document/Telephone.py index a127f121e0..0d4bd53761 100644 --- a/product/ERP5/Document/Telephone.py +++ b/product/ERP5/Document/Telephone.py @@ -98,19 +98,25 @@ class Telephone(Coordinate, Base): script = self._getTypeBasedMethod('asText') if script is not None: return script() + text = '+' - if self.telephone_country != None: - text += self.telephone_country + telephone_country = self.getTelephoneCountry() + if telephone_country is not None: + text += telephone_country + text += '(0)' - if self.telephone_area != None: - text += self.telephone_area + telephone_area = self.getTelephoneArea() + if telephone_area is not None: + text += telephone_area + text += '-' - if self.telephone_number != None: - text += self.telephone_number - if text == '+(0)-' : - return '' - else: - return text + telephone_number = self.getTelephoneNumber() + if self.telephone_number is not None: + text += telephone_number + + if text == '+(0)-': + text = '' + return text security.declareProtected(Permissions.View, 'getText') getText = asText -- 2.30.9