From 706380ef86dc33d7d165402282529d3340fcabf1 Mon Sep 17 00:00:00 2001 From: Guillaume Risbourg Date: Thu, 29 Aug 2019 13:17:02 +0200 Subject: [PATCH] [bnporc] Fixed error for loans with empty balance Closes: 12994@zendesk 43878@sibi Listed in: 12974@zendesk --- modules/bnporc/pp/pages.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/bnporc/pp/pages.py b/modules/bnporc/pp/pages.py index 1ca5e37b41..c642ac8b2e 100644 --- a/modules/bnporc/pp/pages.py +++ b/modules/bnporc/pp/pages.py @@ -315,6 +315,12 @@ class iter_accounts_details(DictElement): item_xpath = 'compte' class item(ItemElement): + def validate(self, obj): + # We skip loans with a balance of 0 because the JSON returned gives + # us no info (only `null` values on all fields), so there is nothing + # useful to display + return obj.type != Account.TYPE_LOAN or obj.balance != 0 + FAMILY_TO_TYPE = { 1: Account.TYPE_CHECKING, 2: Account.TYPE_SAVINGS, -- GitLab