Commit c99a6ac5 authored by Nicolas Joyard's avatar Nicolas Joyard

Fix importer emails

parent d16522f1
......@@ -14,8 +14,10 @@ class NonTrouve(Exception):
class EmailImporter(BaseImporter):
def import_emails(self, nom, emails):
parl = Parlementaire.query.filter(Parlementaire.nom_complet == nom) \
.one()
parl = Parlementaire.query \
.filter(Parlementaire.nom_complet == nom) \
.first()
if not parl:
raise NonTrouve('%s non trouvé' % nom)
......
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