Commit 919a8bb5 authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[cragr] filter able to do transfer accounts

In transfer initiation, get only able to do transfer accounts
parent 672b39f5
......@@ -592,7 +592,9 @@ class CragrAPI(LoginBrowser):
assert self.recipients.is_here()
for index, debit_accounts in enumerate(self.page.iter_debit_accounts()):
debit_accounts._index = index
yield debit_accounts
if self.page.is_sender_account(debit_accounts.id):
# only yield able to do transfer accounts
yield debit_accounts
@need_login
def iter_transfer_recipients(self, account, transfer_space_info=None):
......
......@@ -40,6 +40,11 @@ class RecipientsPage(LoggedPage, JsonPage):
@method
class iter_debit_accounts(DictElement):
def store(self, obj):
# can have accounts with same ID
# filter it on `browser.py` to have 'index' (needed to do transfer)
return obj
class item(ItemElement):
def condition(self):
return Dict('accountNumber', default=None)(self)
......
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