Commit 22cbec48 authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by ntome

[cragr] Refresh account form before trying to fetch the IBAN

On the old website, when a perimeter has several checking accounts, the
first form works but the second account's form is expired, so we must
refresh the account form in order to get the IBAN correctly.

Closes: 12915@zendesk, 13758@zendesk, 13901@zendesk
parent a279148d
......@@ -338,8 +338,11 @@ class CragrRegion(LoginBrowser):
self.accounts.stay_or_go()
self.page.set_cragr_code()
for account in self.page.iter_accounts():
self.accounts.go()
if iban and account._form:
account.iban = self.get_account_iban(account._form)
# Refresh account form in case it expired
refreshed_account = find_object(self.page.iter_accounts(), id=account.id)
account.iban = self.get_account_iban(refreshed_account._form)
if account.id not in [a.id for a in cragr_accounts]:
cragr_accounts.append(account)
......
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