From 6f783ac6fb0c615534613bcc01f5d2f86b09b0b5 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Wed, 30 Jan 2019 11:08:32 +0100 Subject: [PATCH] [cragr] Ignore "assurance" when getting account balances --- modules/cragr/api/pages.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/cragr/api/pages.py b/modules/cragr/api/pages.py index 20e2cdc54c..120a032ad1 100644 --- a/modules/cragr/api/pages.py +++ b/modules/cragr/api/pages.py @@ -230,6 +230,9 @@ def get_account_balances(self): # whereas the account id may not be unique for Loans account_balances = {} for el in self.doc: + # Insurances have no balance, we skip them + if el.get('typeProduit') == 'assurance': + continue value = el.get('solde', el.get('encoursActuel', el.get('valorisationContrat', el.get('montantRestantDu', el.get('capitalDisponible'))))) assert value is not None, 'Could not find the account balance' account_balances[Dict('idElementContrat')(el)] = float_to_decimal(value) -- GitLab