Commit d1fa9f77 authored by Maxime Pommier's avatar Maxime Pommier Committed by Romain Bignon

[caissedepargne] Some user have a market account but they have no access to linebourse

Closes: 8729@zendesk
parent f4ca5a8c
......@@ -411,6 +411,10 @@ class CaisseEpargne(LoginBrowser, StatesMixin):
self.page.submit()
if 'offrebourse.com' in self.url:
# Some users may not have access to this.
if self.page.is_error():
continue
self.update_linebourse_token()
page = self.linebourse.go_portfolio(account.id)
assert self.linebourse.portfolio.is_here()
......
......@@ -762,11 +762,8 @@ class NatixisRedirectPage(LoggedPage, HTMLPage):
class MarketPage(LoggedPage, HTMLPage):
def on_load(self):
error = CleanText('//caption[contains(text(),"Erreur")]')(self.doc)
if error:
message = CleanText('//td[contains(@class,"donneeLongIdent")]')(self.doc)
raise BrowserUnavailable(message)
def is_error(self):
return CleanText('//caption[contains(text(),"Erreur")]')(self.doc)
def parse_decimal(self, td, percentage=False):
value = CleanText('.')(td)
......
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