From a80448ee87854a098639b44c02624bd563c2b866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lande=20Adrien?= Date: Thu, 14 Mar 2019 15:22:05 +0100 Subject: [PATCH] [delubac] handle account with no details Some accounts do not have a link to redirect to their details. So this link is not looked for and not used in navigation unless it exists. Closes: 36455@sibi --- modules/themisbanque/browser.py | 6 ++++-- modules/themisbanque/pages.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/themisbanque/browser.py b/modules/themisbanque/browser.py index 2821536689..24bf4ddba1 100644 --- a/modules/themisbanque/browser.py +++ b/modules/themisbanque/browser.py @@ -57,8 +57,10 @@ def iter_accounts(self): @need_login def get_history(self, account): - self.location(account._link) - return self.page.get_operations() + if account._link: + self.location(account._link) + return self.page.get_operations() + return [] @need_login def get_profile(self): diff --git a/modules/themisbanque/pages.py b/modules/themisbanque/pages.py index e2b11278c9..43d99acedc 100644 --- a/modules/themisbanque/pages.py +++ b/modules/themisbanque/pages.py @@ -28,7 +28,7 @@ from weboob.capabilities.base import NotAvailable from weboob.capabilities.profile import Profile from weboob.browser.filters.standard import CleanText, CleanDecimal, Async, Regexp, Join, Field -from weboob.browser.filters.html import Attr, Link, TableCell, ColumnNotFound +from weboob.browser.filters.html import Link, TableCell, ColumnNotFound from weboob.tools.capabilities.bank.transactions import FrenchTransaction from weboob.tools.capabilities.bank.iban import is_iban_valid from weboob.tools.compat import basestring @@ -99,7 +99,7 @@ def condition(self): obj_balance = CleanDecimal(TableCell('balance'), replace_dots=True) def obj__link(self): - return Attr(TableCell('id')(self)[0].xpath('./a'), 'href')(self) + return Link(TableCell('id')(self)[0].xpath('./a'), default=None)(self) def obj__url(self): return Link(TableCell('rib')(self)[0].xpath('./a[img[starts-with(@alt, "RIB")]]'), default=None)(self) -- GitLab