Commit 1c08eaf8 authored by Nicolas Joyard's avatar Nicolas Joyard

Fix committee vote inconsistencies

parent ab657755
...@@ -51,16 +51,20 @@ class Command(object): ...@@ -51,16 +51,20 @@ class Command(object):
""" """
Parse data from parltrack votes db dumps (1 proposal) Parse data from parltrack votes db dumps (1 proposal)
""" """
if 'epref' not in vote_data.keys(): keys = vote_data.keys()
if 'ep_ref' in keys:
vote_data['epref'] = vote_data['ep_ref']
elif 'epref' not in keys:
logger.debug('Could not import data without epref %s', logger.debug('Could not import data without epref %s',
vote_data['title']) vote_data.get('title',
vote_data.get('doc',
vote_data.get('url', '?'))))
return return
dossier_pk = self.get_dossier(vote_data['epref']) dossier_pk = self.get_dossier(vote_data['epref'])
if not dossier_pk: if not dossier_pk:
logger.debug('Cannot find dossier with remote id %s', logger.debug('Cannot find dossier with remote id %s', epref)
vote_data['epref'])
return return
if 'committee' in vote_data: if 'committee' in vote_data:
......
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
], ],
"total": "1" "total": "1"
}, },
"epref": "2012/2002(INI)", "ep_ref": "2012/2002(INI)",
"-": { "-": {
"groups": [ "groups": [
{ {
......
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