account.id is now only paramNumCompte if there is not paramNumContrat

This commit is contained in:
Baptiste Delpey 2015-03-09 11:43:41 +01:00 committed by Romain Bignon
commit 910b54aff7

View file

@ -151,8 +151,10 @@ class AccountsPage(BasePage):
label = 'Unable to determine'
self.logger.warning('Unable to get account ID for %r' % label)
continue
account.id = args['paramNumCompte'] + args['paramNumContrat']
try:
account.id = args['paramNumCompte'] + args['paramNumContrat']
except KeyError:
account.id = args['paramNumCompte']
account_type_str = table.attrib['class'].split(' ')[-1][len('tableaux-comptes-'):]
account.type = self.ACCOUNT_TYPES.get(account_type_str, Account.TYPE_UNKNOWN)