Skip to content

Commit

Permalink
[mod] conditionnal creation of address informations in the importatio…
Browse files Browse the repository at this point in the history
…n from parltrack script
  • Loading branch information
Psycojoker committed Jul 28, 2011
1 parent 3c38cda commit f57bf43
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions parltrack/current_meps_json_2_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,13 @@ def manage_mep(mep, mep_json):
add_delegations(mep, mep_json.get("Delegations", []))
add_countries(mep, mep_json["Constituencies"])
add_groups(mep, mep_json["Groups"])
add_addrs(mep, mep_json["Addresses"])
if mep_json.get("Addresses"):
add_addrs(mep, mep_json["Addresses"])
add_organizations(mep, mep_json.get("Staff", []))
add_mep_email(mep, mep_json["Mail"])
add_mep_website(mep, mep_json["Homepage"])
if mep_json.get("Mail"):
add_mep_email(mep, mep_json["Mail"])
if mep_json.get("Homepage"):
add_mep_website(mep, mep_json["Homepage"])
add_mep_cv(mep, mep_json.get("CV", []))
print " save mep modifications"
mep.save()
Expand Down

0 comments on commit f57bf43

Please sign in to comment.