From 03f98a17e0865e3f394cc2985cfcfcd88122f5dd Mon Sep 17 00:00:00 2001 From: Sylvie Ye Date: Wed, 5 Jun 2019 17:02:17 +0200 Subject: [PATCH] [banquepopulaire] add condition to retrieve IBAN or not don't go on IBAN details page if the current page is not the IBAN page --- modules/banquepopulaire/pages.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/banquepopulaire/pages.py b/modules/banquepopulaire/pages.py index 8287cafdc7..5a27b6af10 100644 --- a/modules/banquepopulaire/pages.py +++ b/modules/banquepopulaire/pages.py @@ -1002,7 +1002,12 @@ def need_to_go(self): def go_iban(self, account): for tr in self.doc.xpath('//table[@id]/tbody/tr'): - if account.type not in (Account.TYPE_LOAN, Account.TYPE_MARKET) and CleanText().filter(tr.xpath('./td[1]')) in account.id: + conditions = ( + account.type not in (Account.TYPE_LOAN, Account.TYPE_MARKET), + CleanText().filter(tr.xpath('./td[1]')) in account.id, + self.doc.xpath('//div[contains(text(), "Impression IBAN/RIB")]'), + ) + if all(conditions): form = self.get_form(id='myForm') form['token'] = self.build_token(form['token']) form['dialogActionPerformed'] = "DETAIL_IBAN_RIB" -- GitLab