From be9c8ac87c214cd1f4ad4da5b2d0c20c073d6eff Mon Sep 17 00:00:00 2001 From: Damien Mat Date: Thu, 30 Apr 2020 11:04:52 +0200 Subject: [PATCH] [caissedepargne] cenet: manage TYPE_SAVINGS accounts and homogenize account typing --- modules/caissedepargne/cenet/browser.py | 5 ++--- modules/caissedepargne/cenet/pages.py | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/caissedepargne/cenet/browser.py b/modules/caissedepargne/cenet/browser.py index 1569962230..e305c2f878 100644 --- a/modules/caissedepargne/cenet/browser.py +++ b/modules/caissedepargne/cenet/browser.py @@ -28,7 +28,6 @@ from weboob.browser.exceptions import ClientError from weboob.exceptions import BrowserIncorrectPassword, BrowserUnavailable from weboob.capabilities.base import find_object -from weboob.capabilities.bank import Account from weboob.tools.capabilities.bank.transactions import ( sorted_transactions, omit_deferred_transactions, keep_only_card_transactions, ) @@ -190,7 +189,7 @@ def _matches_card(self, tr, full_id): @need_login def get_history(self, account): - if account.type == Account.TYPE_LOAN: + if account.type in (account.TYPE_LOAN, account.TYPE_SAVINGS): return [] if account.type == account.TYPE_CARD: @@ -259,7 +258,7 @@ def get_history_base(self, account, card_number=None): @need_login def get_coming(self, account): - if account.type != Account.TYPE_CARD: + if account.type != account.TYPE_CARD: return [] trs = [] diff --git a/modules/caissedepargne/cenet/pages.py b/modules/caissedepargne/cenet/pages.py index efaa93ab55..6e922b443b 100644 --- a/modules/caissedepargne/cenet/pages.py +++ b/modules/caissedepargne/cenet/pages.py @@ -112,7 +112,10 @@ def __init__(self, browser, response, *args, **kwargs): class CenetAccountsPage(LoggedPage, CenetJsonPage): - ACCOUNT_TYPES = {'CCP': Account.TYPE_CHECKING} + ACCOUNT_TYPES = { + 'CCP': Account.TYPE_CHECKING, + 'DAT': Account.TYPE_SAVINGS, + } @method class get_accounts(DictElement): -- GitLab