[attributs] assert value is not only unicode but can also be of the specified python type

This commit is contained in:
Valentin Samir 2014-02-14 00:45:12 +01:00
parent 0486929a5a
commit aea8e9d974
2 changed files with 3 additions and 3 deletions

View file

@ -1029,8 +1029,8 @@ class facture(CransLdapObject):
# ajoute à la liste d'articles de frais
self._frais.append(attributs.attrify('FRAIS~~Frais de tansaction PayPal~~1~~%s' % round(s, 2), 'article', self.conn, Parent=self))
def __getitem__(self,attr):
ret = super(facture, self).__getitem__(attr)
def __getitem__(self,attr, default=None):
ret = super(facture, self).__getitem__(attr, default)
if attr == 'article' and self.mode == 'ro':
return ret + self._frais
else: