From 310db131003bb3adf352c6c24bca9e39a601dfb4 Mon Sep 17 00:00:00 2001 From: Maxime Pommier Date: Tue, 11 Jun 2019 10:55:51 +0200 Subject: [PATCH] =?UTF-8?q?[boursorama]=C2=A0Avoid=20to=20get=203=20years?= =?UTF-8?q?=20of=20history=20for=20nothing=20when=20we=20get=20coming=20tr?= =?UTF-8?q?ansaction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/boursorama/browser.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/boursorama/browser.py b/modules/boursorama/browser.py index 5a522636ab..4fb368365b 100644 --- a/modules/boursorama/browser.py +++ b/modules/boursorama/browser.py @@ -338,11 +338,12 @@ def get_regular_transactions(self, account, coming): params['movementSearch[toDate]'] = (date.today() + relativedelta(days=40)).strftime('%d/%m/%Y') params['movementSearch[fromDate]'] = (date.today() - relativedelta(years=3)).strftime('%d/%m/%Y') params['movementSearch[selectedAccounts][]'] = account._webid - self.location('%s/mouvements' % account.url.rstrip('/'), params=params) - for transaction in self.page.iter_history(): - yield transaction + if not coming: + self.location('%s/mouvements' % account.url.rstrip('/'), params=params) + for transaction in self.page.iter_history(): + yield transaction - if coming and account.type == Account.TYPE_CHECKING: + elif account.type == Account.TYPE_CHECKING: self.location('%s/mouvements-a-venir' % account.url.rstrip('/'), params=params) for transaction in self.page.iter_history(coming=True): yield transaction -- GitLab