Commit 57e06a10 authored by Simon Rochwerg's avatar Simon Rochwerg Committed by Romain Bignon

[bnporc] handles cases when bnporc's api sends empty json fields for profile

Closes: 9334@sibi
parent 1eb7de0e
......@@ -31,7 +31,7 @@ from weboob.browser.pages import JsonPage, LoggedPage, HTMLPage
from weboob.capabilities import NotAvailable
from import Account, Investment, Recipient, Transfer, TransferError, TransferBankError, AddRecipientError
from import Advisor
from weboob.capabilities.profile import Person
from weboob.capabilities.profile import Person, ProfileMissing
from weboob.exceptions import BrowserIncorrectPassword, BrowserUnavailable, BrowserPasswordExpired, ActionNeeded
from import rib2iban, rebuild_rib, is_iban_valid
from import FrenchTransaction
......@@ -247,17 +247,17 @@ class ProfilePage(LoggedPage, JsonPage):
klass = Person
def parse(self, el):
if not Dict(self.item_path + 'etatCivil/prenom')(el).strip() and not Dict(self.item_path + 'etatCivil/nom')(el).strip():
raise ProfileMissing()
obj_name = Format('%s %s', Dict(item_path + 'etatCivil/prenom'), Dict(item_path + 'etatCivil/nom'))
obj_spouse_name = Dict(item_path + 'etatCivil/nomMarital', default=NotAvailable)
obj_birth_date = Date(Dict(item_path + 'etatCivil/dateNaissance'), dayfirst=True)
obj_nationality = Dict(item_path + 'etatCivil/nationnalite')
obj_phone = Dict(item_path + 'etatCivil/numMobile')
obj_email = Dict(item_path + 'etatCivil/mail')
obj_job = Dict(item_path + 'situationPro/activiteExercee')
obj_job_start_date = Date(Dict(item_path + 'situationPro/dateDebut'), dayfirst=True, default=NotAvailable)
obj_company_name = Dict(item_path + 'situationPro/nomEmployeur')
def obj_company_siren(self):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment