Commit 25f8ab62 authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Romain Bignon
Browse files

[caissedepargne] Repair connection to linebourse for creditcooperatif

The Crédit Coopératif connections could not access the Linebourse space
because the in update_linebourse_token() method, the domain was
hardcoded and only worked for the caissedepargne module.
parent 13c1982c
......@@ -38,7 +38,7 @@
from import sorted_transactions, FrenchTransaction
from import create_french_liquidity
from import urljoin
from import urljoin, urlparse
from import Value
from import retry
......@@ -380,7 +380,11 @@ def get_measure_accounts_list(self):
def update_linebourse_token(self):
assert self.linebourse is not None, "linebourse browser should already exist"
self.linebourse.session.headers['X-XSRF-TOKEN'] = self.session.cookies.get('XSRF-TOKEN', domain='')
# It is important to fetch the domain dynamically because
# for caissedepargne the domain is ''
# whereas for creditcooperatif it is ''
domain = urlparse(self.url).netloc
self.linebourse.session.headers['X-XSRF-TOKEN'] = self.session.cookies.get('XSRF-TOKEN', domain=domain)
@retry(ClientError, tries=3)
Supports Markdown
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