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':
|
if td.attrib.get('headers', '') == 'TypeCompte':
|
||||||
a = td.find('a')
|
a = td.find('a')
|
||||||
if a is None:
|
if a is None:
|
||||||
continue
|
break
|
||||||
account.label = unicode(a.find("span").text)
|
account.label = unicode(a.find("span").text)
|
||||||
account._link_id = a.get('href', '')
|
account._link_id = a.get('href', '')
|
||||||
|
|
||||||
|
|
@ -65,7 +65,7 @@ class AccountsList(BasePage):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
elif td.attrib.get('headers', '') == 'Solde':
|
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:
|
if balance != None:
|
||||||
account.currency = account.get_currency(balance)
|
account.currency = account.get_currency(balance)
|
||||||
balance = FrenchTransaction.clean_amount(balance)
|
balance = FrenchTransaction.clean_amount(balance)
|
||||||
|
|
@ -73,6 +73,9 @@ class AccountsList(BasePage):
|
||||||
else:
|
else:
|
||||||
account.balance = Decimal(0)
|
account.balance = Decimal(0)
|
||||||
|
|
||||||
|
if not account.label:
|
||||||
|
continue
|
||||||
|
|
||||||
if 'CARTE_' in account._link_id:
|
if 'CARTE_' in account._link_id:
|
||||||
ac = accounts[0]
|
ac = accounts[0]
|
||||||
ac._card_links.append(account._link_id)
|
ac._card_links.append(account._link_id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue