Commit a80448ee authored by Célande Adrien's avatar Célande Adrien Committed by Romain Bignon

[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
parent 7eb7b0eb
......@@ -57,8 +57,10 @@ class ThemisBrowser(LoginBrowser):
@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):
......
......@@ -28,7 +28,7 @@ from weboob.capabilities.bank import Account
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 @@ class AccountsPage(LoggedPage, HTMLPage):
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)
......
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