diff --git a/modules/boursorama/browser.py b/modules/boursorama/browser.py index c13fd5e419c8c61c61c1bba160494415118896a9..f104dba092b2a5d4aa04324aca004c9824ef8013 100644 --- a/modules/boursorama/browser.py +++ b/modules/boursorama/browser.py @@ -42,7 +42,7 @@ AddRecipientTimeout, TransferDateType, Emitter, TransactionType, AddRecipientBankError, ) -from weboob.capabilities.base import NotLoaded, empty, find_object +from weboob.capabilities.base import NotLoaded, empty, find_object, strict_find_object from weboob.capabilities.contact import Advisor from weboob.tools.value import Value from weboob.tools.compat import basestring, urlsplit @@ -436,13 +436,12 @@ def get_accounts_list(self): self.ownership_guesser() return self.accounts_list - def get_account(self, id): - assert isinstance(id, basestring) - - for a in self.get_accounts_list(): - if a.id == id: - return a - return None + def get_account(self, account_id=None, account_iban=None): + acc_list = self.get_accounts_list() + account = strict_find_object(acc_list, id=account_id) + if not account: + account = strict_find_object(acc_list, iban=account_iban) + return account def get_opening_date(self, account_url): self.location(account_url) @@ -695,7 +694,7 @@ def init_transfer(self, transfer, **kwargs): self.check_basic_transfer(transfer) - account = self.get_account(transfer.account_id) + account = self.get_account(transfer.account_id, transfer.account_iban) if not account: raise AccountNotFound() diff --git a/modules/boursorama/module.py b/modules/boursorama/module.py index e1ed5edc378c16d6bf663521e5a9df06572959c5..5b77e689da330502c1c296c654244a53706f4a29 100644 --- a/modules/boursorama/module.py +++ b/modules/boursorama/module.py @@ -123,6 +123,14 @@ def transfer_check_label(self, old, new): old = old.replace('\ufffd', '?') return super(BoursoramaModule, self).transfer_check_label(old, new) + def transfer_check_account_id(self, old, new): + # We can't verify here automatically that the account_id has not changed + # as it might have changed early if a stet account id was provided + # instead of the account id that we use here coming from the website. + # And in addition, we don't get the account id from the confirmation page + # to perform such a check anyway. + return True + def iter_currencies(self): return self.browser.iter_currencies()