Commit de6e967a authored by Guillaume Risbourg's avatar Guillaume Risbourg Committed by Vincent A

[lcl] Add transfer_check_account_iban

Some accounts' ibans cannot be found anymore on the website. But since we
kept the iban stored on our side, the 'old' transfer.account_iban is not
empty when making a transfer. When we do not find the account based on its iban,
we search it based on its id. So the account is valid, the iban is just different.
This check allows to not have an assertion error when making a transfer from
an account in this situation.
parent bed707b9
......@@ -37,7 +37,9 @@ from weboob.capabilities.profile import CapProfile
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.capabilities.bank.transactions import sorted_transactions
from weboob.tools.value import ValueBackendPassword, Value
from weboob.capabilities.base import find_object, strict_find_object, NotAvailable
from weboob.capabilities.base import (
find_object, strict_find_object, NotAvailable, empty,
)
from .browser import LCLBrowser, LCLProBrowser
from .enterprise.browser import LCLEnterpriseBrowser, LCLEspaceProBrowser
......@@ -173,6 +175,17 @@ class LCLModule(Module, CapBankWealth, CapBankTransferAddRecipient, CapContact,
return True
return super(LCLModule, self).transfer_check_label(old, new)
def transfer_check_account_iban(self, old, new):
# Some accounts' ibans cannot be found anymore on the website. But since we
# kept the iban stored on our side, the 'old' transfer.account_iban is not
# empty when making a transfer. When we do not find the account based on its iban,
# we search it based on its id. So the account is valid, the iban is just empty.
# This check allows to not have an assertion error when making a transfer from
# an account in this situation.
if empty(new):
return True
return old == new
@only_for_websites('par', 'elcl', 'pro')
def iter_contacts(self):
return self.browser.get_advisor()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment