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,18 +98,24 @@ 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:
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')
......
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