From 910b54aff7dc6c4d723578053f4eaabb11141f6f Mon Sep 17 00:00:00 2001 From: Baptiste Delpey Date: Mon, 9 Mar 2015 11:43:41 +0100 Subject: [PATCH] account.id is now only paramNumCompte if there is not paramNumContrat --- modules/axabanque/pages.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/axabanque/pages.py b/modules/axabanque/pages.py index 9c85a27d..da80bf25 100644 --- a/modules/axabanque/pages.py +++ b/modules/axabanque/pages.py @@ -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)