Commit 61dfc90b authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[bnp] avoid recipient with same iban

recipient id can change,
avoid to retrieve duplicate recipient to not search recipient by id in transfer
and search by iban
parent 1bca3c79
......@@ -30,7 +30,7 @@ from import (
from weboob.capabilities.messages import CapMessages, Thread
from import CapContact
from weboob.capabilities.profile import CapProfile
from weboob.capabilities.base import find_object
from weboob.capabilities.base import find_object, strict_find_object
from import Module, BackendConfig
from import ValueBackendPassword, Value, ValueBool
......@@ -119,7 +119,9 @@ class BNPorcModule(Module, CapBankWealth, CapBankTransferAddRecipient, CapMessag
account = find_object(self.iter_accounts(), id=transfer.account_id, error=AccountNotFound)
recipient = find_object(self.iter_transfer_recipients(, id=transfer.recipient_id, error=RecipientNotFound)
recipient = strict_find_object(self.iter_transfer_recipients(, iban=transfer.recipient_iban)
if not recipient:
recipient = strict_find_object(self.iter_transfer_recipients(, id=transfer.recipient_id, error=RecipientNotFound)
# quantize to show 2 decimals.
......@@ -327,10 +327,17 @@ class BNPParibasBrowser(JsonBrowserMixin, LoginBrowser):
except TransferError:
# avoid recipient with same iban
seen = set()
for recipient in
if recipient.iban not in seen:
yield recipient
for recipient in self.recipients.go(data=JSON({'type': 'TOUS'})).iter_recipients():
if recipient.iban not in seen:
yield recipient
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