do not crash when an account is unavailable

This commit is contained in:
Romain Bignon 2013-02-04 14:01:51 +01:00
commit f61b71fb99

View file

@ -52,7 +52,7 @@ class AccountsList(BasePage):
if td.attrib.get('headers', '') == 'TypeCompte':
a = td.find('a')
if a is None:
continue
break
account.label = unicode(a.find("span").text)
account._link_id = a.get('href', '')
@ -65,7 +65,7 @@ class AccountsList(BasePage):
pass
elif td.attrib.get('headers', '') == 'Solde':
balance = td.find('div').text
balance = td.find('div').text if td.find('div') is not None else None
if balance != None:
account.currency = account.get_currency(balance)
balance = FrenchTransaction.clean_amount(balance)
@ -73,6 +73,9 @@ class AccountsList(BasePage):
else:
account.balance = Decimal(0)
if not account.label:
continue
if 'CARTE_' in account._link_id:
ac = accounts[0]
ac._card_links.append(account._link_id)