do not crash when an account is unavailable
This commit is contained in:
parent
32db47cf37
commit
f61b71fb99
1 changed files with 5 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue