Commit b39d16e9 authored by Damien Mat's avatar Damien Mat Committed by ntome

[esalia] Fix nav between several investments accounts popups

Investments performances in this module can be fecthed by launching 3
different popups depending on the user's contrats. When wanting the
investments we first collect the urls of each popup then follow each one
and parse the performances from there. When the user has sggestion.com
and lyxorfunds.com invests with first url fetched being lyxorfunds.com,
at the time to follow it, the request would not be accepted and return a
ClientError. If the urls are fetched the other way around, the requests
would work, this is the most cases behavior. In order to make
lyxorfunds.com requests to work everytime we need the referer from
homepage (AccountsPage).
parent 4a15ec3d
......@@ -165,7 +165,8 @@ class S2eBrowser(LoginBrowser, StatesMixin):
elif self.amfcode_sg.match(inv._link) or self.lyxorfunds.match(inv._link):
# Esalia (Société Générale Épargne Salariale) or Lyxor investments
# Not all sggestion-ede.com or lyxorfunds.com have available performances.
self.location(inv._link)
# For those requests to work in every case we need the headers from AccountsPage
self.location(inv._link, headers={'Referer': self.accounts.build(slug=self.SLUG)})
inv.performance_history = self.page.get_investment_performances()
return investments
......
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