From aa7344b34ee98f5a13573c1071093629c89ab453 Mon Sep 17 00:00:00 2001 From: Jerome Berthier Date: Wed, 24 Apr 2019 09:52:02 +0200 Subject: [PATCH] [cragr] Fix duplicated accounts id when there are consumer credits Like for the loans, the attribute numeroCompte refers to the main account, so we use the contract id as the account id. --- modules/cragr/api/pages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cragr/api/pages.py b/modules/cragr/api/pages.py index 27cb8fd4ec..637277e245 100644 --- a/modules/cragr/api/pages.py +++ b/modules/cragr/api/pages.py @@ -227,8 +227,8 @@ class item(ItemElement): klass = Account def obj_id(self): - # Loan ids may be duplicated so we use the contract number for now: - if Field('type')(self) == Account.TYPE_LOAN: + # Loan/credit ids may be duplicated so we use the contract number for now: + if Field('type')(self) in (Account.TYPE_LOAN, Account.TYPE_CONSUMER_CREDIT): return CleanText(Dict('idElementContrat'))(self) return CleanText(Dict('numeroCompte'))(self) -- GitLab