From f5ff2c4ff499cb9016f8a86852c2c9f081233765 Mon Sep 17 00:00:00 2001 From: Guillaume Risbourg Date: Wed, 11 Sep 2019 10:46:14 +0200 Subject: [PATCH] [bnporc] Fix bug when loans data is empty Closes: 45456@sibi --- modules/bnporc/pp/pages.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/bnporc/pp/pages.py b/modules/bnporc/pp/pages.py index 52069ae2b9..c7e8847660 100644 --- a/modules/bnporc/pp/pages.py +++ b/modules/bnporc/pp/pages.py @@ -386,6 +386,11 @@ def parse(self, el): class LoanDetailsPage(BNPPage): @method class fill_loan_details(ItemElement): + def condition(self): + # If the loan doesn't have any info (that means the loan is already refund), + # the data/message is null whereas it is set to "OK" when everything is fine. + return Dict('data/message')(self) == 'OK' + obj_total_amount = Dict('data/montantPret') obj_maturity_date = Date(Dict('data/dateEcheanceRemboursement'), dayfirst=True) obj_duration = Dict('data/dureeRemboursement') -- GitLab