From 1bd5c64daa1e5154ece4c035bdff8a74ebc71c6f Mon Sep 17 00:00:00 2001 From: Maxime Gasselin Date: Fri, 31 May 2019 12:07:52 +0200 Subject: [PATCH] [bp] avoid bug for empty market account We returned a None liquidity object. We now return an empty list. Closes: 10880@zendesk --- modules/bp/browser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/bp/browser.py b/modules/bp/browser.py index 611b28538e..ae5fedc611 100644 --- a/modules/bp/browser.py +++ b/modules/bp/browser.py @@ -418,7 +418,10 @@ def iter_investment(self, account): if account.type in (account.TYPE_PEA, account.TYPE_MARKET): self.go_linebourse(account) investments = list(self.linebourse.iter_investment(account.id)) - investments.append(self.linebourse.get_liquidity(account.id)) + liquidity = self.linebourse.get_liquidity(account.id) + if liquidity: + # avoid to append None + investments.append(liquidity) return investments if account.type != Account.TYPE_LIFE_INSURANCE: -- GitLab