Commit ff8b5aeb authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by ntome

[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.
parent 4dbd8a84
......@@ -56,6 +56,9 @@ class AmundiBrowser(LoginBrowser):
@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):
......
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