Commit 7dc28a0d authored by Romain Courteaud's avatar Romain Courteaud

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
parent 65a30e82
...@@ -98,19 +98,25 @@ class Telephone(Coordinate, Base): ...@@ -98,19 +98,25 @@ class Telephone(Coordinate, Base):
script = self._getTypeBasedMethod('asText') script = self._getTypeBasedMethod('asText')
if script is not None: if script is not None:
return script() return script()
text = '+' text = '+'
if self.telephone_country != None: telephone_country = self.getTelephoneCountry()
text += self.telephone_country if telephone_country is not None:
text += telephone_country
text += '(0)' text += '(0)'
if self.telephone_area != None: telephone_area = self.getTelephoneArea()
text += self.telephone_area if telephone_area is not None:
text += telephone_area
text += '-' text += '-'
if self.telephone_number != None: telephone_number = self.getTelephoneNumber()
text += self.telephone_number if self.telephone_number is not None:
if text == '+(0)-' : text += telephone_number
return ''
else: if text == '+(0)-':
return text text = ''
return text
security.declareProtected(Permissions.View, 'getText') security.declareProtected(Permissions.View, 'getText')
getText = asText getText = asText
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment