Commit 22dbfdae authored by Maxime Pommier's avatar Maxime Pommier Committed by Romain Bignon

[lcl] Added account_owner_type to account

parent 87460de4
......@@ -27,7 +27,7 @@ from weboob.exceptions import BrowserIncorrectPassword, BrowserUnavailable
from weboob.browser import LoginBrowser, URL, need_login, StatesMixin
from weboob.browser.exceptions import ServerError
from weboob.capabilities.base import NotAvailable
from import Account, AddRecipientBankError, AddRecipientStep, Recipient
from import Account, AddRecipientBankError, AddRecipientStep, Recipient, AccountOwnerType
from import create_french_liquidity
from import basestring, urlsplit, parse_qsl, unicode
from import Value
......@@ -126,6 +126,7 @@ class LCLBrowser(LoginBrowser, StatesMixin):
self.accounts_list = None
self.current_contract = None
self.contracts = None
self.owner_type = AccountOwnerType.PRIVATE
def load_state(self, state):
super(LCLBrowser, self).load_state(state)
......@@ -284,6 +285,9 @@ class LCLBrowser(LoginBrowser, StatesMixin):
for account in self.accounts_list:
account.owner_type = self.owner_type
return iter(self.accounts_list)
def get_bourse_accounts_ids(self):
......@@ -540,6 +544,7 @@ class LCLProBrowser(LCLBrowser):
def __init__(self, *args, **kwargs):
super(LCLProBrowser, self).__init__(*args, **kwargs)
self.session.cookies.set("lclgen", "professionnels", domain=urlsplit(self.BASEURL).hostname)
self.owner_type = AccountOwnerType.ORGANIZATION
class ELCLBrowser(LCLBrowser):
......@@ -20,6 +20,7 @@
from weboob.browser import LoginBrowser, URL, need_login
from weboob.exceptions import BrowserIncorrectPassword
from import AccountOwnerType
from .pages import LoginPage, MovementsPage, ProfilePage, PassExpiredPage
......@@ -37,6 +38,8 @@ class LCLEnterpriseBrowser(LoginBrowser):
def __init__(self, *args, **kwargs):
super(LCLEnterpriseBrowser, self).__init__(*args, **kwargs)
self.accounts = None
self.owner_type = AccountOwnerType.ORGANIZATION
def deinit(self):
if and
......@@ -57,7 +60,10 @@ class LCLEnterpriseBrowser(LoginBrowser):
def get_accounts_list(self):
if not self.accounts:
self.accounts = list(self.movements.go().iter_accounts())
return self.accounts
for account in self.accounts:
account.owner_type = self.owner_type
yield account
def get_history(self, account):
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