Commit 1394a3cd authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[cragr] check on recipient id to avoid duplicate

saving account iban is not retrieve,
check on recipient id to avoid saving account to be on their own recipient list
parent ea1da515
......@@ -613,18 +613,18 @@ class CragrAPI(LoginBrowser):
# can't use 'ignore_duplicate' in DictElement because we need the 'index' to do transfer
seen = set()
seen.add(account.iban)
seen.add(account.id)
for index, internal_rcpt in enumerate(self.page.iter_internal_recipient()):
internal_rcpt._index = index
if internal_rcpt._is_recipient and (internal_rcpt.iban not in seen):
seen.add(internal_rcpt.iban)
if internal_rcpt._is_recipient and (internal_rcpt.id not in seen):
seen.add(internal_rcpt.id)
yield internal_rcpt
for index, external_rcpt in enumerate(self.page.iter_external_recipient()):
external_rcpt._index = index
if external_rcpt.iban not in seen:
seen.add(external_rcpt.iban)
if external_rcpt.id not in seen:
seen.add(external_rcpt.id)
yield external_rcpt
@need_login
......
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