diff --git a/modules/bp/browser.py b/modules/bp/browser.py index c556ab9d3d0c9d6e6cd14b98b7312b72adfe0460..84b99c928f60827f7ab72bfe5b6e4537f19e2b6c 100644 --- a/modules/bp/browser.py +++ b/modules/bp/browser.py @@ -650,10 +650,14 @@ def get_loans(self, account): student_loan.currency = account.currency loans.append(student_loan) else: + # The main revolving page is not accessible, we can reach it by this new way self.go_revolving() - revolving_loan = self.page.get_revolving_attributes(account) - loans.append(revolving_loan) + if self.page.get_error(): + self.logger.warning('Details are not available for this revolving account: %s', account.id) + else: + revolving_loan = self.page.get_revolving_attributes(account) + loans.append(revolving_loan) return loans @retry(BrowserUnavailable, delay=5) diff --git a/modules/bp/pages/accountlist.py b/modules/bp/pages/accountlist.py index 5fc6e2d0d9761cee3b80f177b2a6be08b9af1f98..a2674cf0e8f95b196782633ad0cd28fca831ba3e 100644 --- a/modules/bp/pages/accountlist.py +++ b/modules/bp/pages/accountlist.py @@ -654,3 +654,6 @@ def get_revolving_attributes(self, account): loan._has_cards = False loan.type = Account.TYPE_REVOLVING_CREDIT return loan + + def get_error(self): + return CleanText('//td[contains(text(), "momentanément indisponible.")]')(self.doc)