From b3c12847b1429d53b81027b2e447b951f46823ad Mon Sep 17 00:00:00 2001 From: Christophe Francois Date: Mon, 6 Jul 2020 15:49:51 +0200 Subject: [PATCH] [creditcooperatif] Fetch history of savings accounts in CenetBrowser The call fails on caissedepargne for savings accounts but it works fine on creditcooperatif. --- modules/caissedepargne/cenet/browser.py | 5 ++++- modules/creditcooperatif/cenet_browser.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/caissedepargne/cenet/browser.py b/modules/caissedepargne/cenet/browser.py index 340363b7be..93a6c5ecca 100644 --- a/modules/caissedepargne/cenet/browser.py +++ b/modules/caissedepargne/cenet/browser.py @@ -191,9 +191,12 @@ def get_loans_list(self): def _matches_card(self, tr, full_id): return fnmatch(full_id, tr.card) + def has_no_history(self, account): + return account.type in (account.TYPE_LOAN, account.TYPE_SAVINGS) + @need_login def get_history(self, account): - if account.type in (account.TYPE_LOAN, account.TYPE_SAVINGS): + if self.has_no_history(account): return [] if account.type == account.TYPE_CARD: diff --git a/modules/creditcooperatif/cenet_browser.py b/modules/creditcooperatif/cenet_browser.py index 37f59e9560..c1564741ec 100644 --- a/modules/creditcooperatif/cenet_browser.py +++ b/modules/creditcooperatif/cenet_browser.py @@ -18,6 +18,7 @@ # along with this weboob module. If not, see . from weboob.browser import AbstractBrowser +from weboob.capabilities.bank import Account __all__ = ['CenetBrowser'] @@ -31,3 +32,6 @@ class CenetBrowser(AbstractBrowser): def __init__(self, nuser, *args, **kwargs): kwargs['domain'] = 'www.credit-cooperatif.coop' super(CenetBrowser, self).__init__(nuser, *args, **kwargs) + + def has_no_history(self, account): + return account.type == Account.TYPE_LOAN -- GitLab