diff --git a/modules/bnporc/pp/pages.py b/modules/bnporc/pp/pages.py index 52069ae2b94d226aa5ade55e5dc40aac5f983502..c7e8847660d7e0a91ca16168bbc9bac564f00fad 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')