From 22cbec48a21e2f4e9b72b4e2cee39aeaa10e5df3 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Mon, 14 Oct 2019 17:46:18 +0200 Subject: [PATCH] [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 --- modules/cragr/regions/browser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/cragr/regions/browser.py b/modules/cragr/regions/browser.py index f9e6eb629f..0140505ef7 100644 --- a/modules/cragr/regions/browser.py +++ b/modules/cragr/regions/browser.py @@ -338,8 +338,11 @@ def iter_perimeter_accounts(self, iban, all_accounts): 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) -- GitLab