ajout de l'import des tiers SAGA comme clé de fédération

This commit is contained in:
Benjamin Dauvergne 2017-03-21 15:25:24 +01:00
parent fc6c12dee5
commit 9d9194d22e
2 changed files with 7 additions and 1 deletions

View File

@ -157,6 +157,7 @@ ZOO_NANTERRE_APPLICATIONS = {
'implicit': 'Implicit',
'authentic': 'Portail',
'saga': 'SAGA',
'saga_tiers': 'Tiers SAGA',
}
local_settings_file = os.environ.get('ZOO_SETTINGS_FILE')

View File

@ -75,7 +75,7 @@ for (individualid, gender, firstname, lastname, nameofuse, email, phones, legals
'nom_d_usage': nameofuse.upper(),
'statut_legal': statut_legal,
'date_de_naissance': birthdate.isoformat(),
'cles_de_federation': mappings,
'cles_de_federation': mappings or {},
}
if telephones:
content['telephones'] = telephones
@ -85,6 +85,11 @@ for (individualid, gender, firstname, lastname, nameofuse, email, phones, legals
individu_mapping[individualid] = e
individu_batch.append(e)
cursor.execute('''SELECT id, individ FROM onlinepaymet''')
for tiers_saga, individualid in cursor.fetchall():
individu_mapping[individualid].content['cles_de_federation']['saga_tiers'] = str(tiers_saga)
Entity.objects.bulk_create(individu_batch)
adresse_batch = []