Commit fa9c2b7d authored by okhin's avatar okhin 🚴

Adding twitter and photo upload

parent e35d7f04
Pipeline #2432 passed with stages
in 2 minutes and 20 seconds
"first_name","last_name","birth_date","mandates:committee","mandates:group","phones:office phone","emails:official","twitter",
"John","Doe","1970-12-01","INTA,LIBE","S&D","+33123456789","johndoe@exmaple.com","https://twitter.com/johndoe/",
"Jane","Doe","1970-12-01","INTA,ITRE","S&D","+33123456789","janedoe@exmaple.com","https://twitter.com/johndoe/",
"first_name","last_name","birth_date","mandates:committee","mandates:group","phones:office phone","emails:official","twitter","photo",
"John","Doe","1970-12-01","INTA,LIBE","S&D","+33123456789","johndoe@exmaple.com","https://twitter.com/johndoe/","https://photo.example.com/Jon_Doe.jpg",
"Jane","Doe","1970-12-01","INTA,ITRE","S&D","+33123456789","janedoe@exmaple.com","https://twitter.com/johndoe/","https://photo.example.com/Jon_Doe.jpg",
......@@ -102,6 +102,9 @@ class Importer(models.Model):
if 'photo' in import_contact:
updated_contact['photo'] = import_contact['photo']
# Let's get the twitter profile
if 'twitter' in import_contact:
updated_contact['twitter'] = import_contact['twitter']
# Let's update_or_create the contact
contact, updated = Contact.objects.update_or_create(first_name=import_contact['first_name'],
last_name=import_contact['last_name'],
......@@ -179,6 +182,7 @@ class Importer(models.Model):
parsed_item['birth_date'] = item['birth_date']
parsed_item['mandates'] = mandates
parsed_item['contacts'] = contacts
parsed_item['photo'] = item['photo']
import_data.append(parsed_item)
else:
# We're in json, let's load from a file
......
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