Commit 343d33a3 authored by njoyard's avatar njoyard Committed by GitHub

Merge pull request #34 from political-memory/francedata-fixes

Francedata representatives import fixes
parents 43fddc67 7da872ab
......@@ -152,6 +152,10 @@ class FranceDataImporter(GenericImporter):
def import_representative_details(self, representative, rep_json):
representative.active = True
if rep_json.get("ancien_depute", 0) == 1:
representative.active = False
if rep_json.get("ancien_senateur", 0) == 1:
representative.active = False
if rep_json.get("date_naissance"):
representative.birth_date = _parse_date(rep_json["date_naissance"])
......@@ -159,6 +163,8 @@ class FranceDataImporter(GenericImporter):
representative.birth_place = rep_json["lieu_naissance"]
representative.photo = rep_json['photo_url']
representative.first_name = rep_json['prenom']
representative.last_name = rep_json['nom_de_famille']
representative.full_name = rep_json["nom"]
gender_convertion_dict = {
......
......@@ -7,6 +7,8 @@
"cv": "",
"active": true,
"birth_place": "Lille (Nord)",
"first_name": "Bernard",
"last_name": "Roman",
"full_name": "Bernard Roman",
"birth_date": "1952-07-15",
"slug": "bernard-roman"
......@@ -22,6 +24,8 @@
"cv": "",
"active": true,
"birth_place": "non disponible",
"first_name": "David",
"last_name": "Assouline",
"full_name": "David Assouline",
"birth_date": "1959-06-16",
"slug": "david-assouline"
......
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