From ff8b5aebe902a724fc7598d1a97175bb99f06f3f Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Thu, 29 Aug 2019 17:41:19 +0200 Subject: [PATCH] [amundi/caels] Skip iter_investments for accounts with null balance If there is no money on the account, no need to do requests just to figure out there is no investment on it. --- modules/amundi/browser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/amundi/browser.py b/modules/amundi/browser.py index 8b043ec329..8064befe8e 100644 --- a/modules/amundi/browser.py +++ b/modules/amundi/browser.py @@ -56,6 +56,9 @@ def iter_accounts(self): @need_login def iter_investment(self, account): + if account.balance == 0: + self.logger.info('Account %s has a null balance, no investment available.', account.label) + return headers = {'X-noee-authorization': 'noeprd %s' % self.token} self.accounts.go(headers=headers) for inv in self.page.iter_investments(account_id=account.id): -- GitLab