Commit bebdd4fd authored by Nicolas Joyard's avatar Nicolas Joyard

Extract 3

parent 52f4d92e
......@@ -241,7 +241,7 @@ def extraire_mails_cada(app):
with open(os.path.join(emails_root, eml)) as f:
message = email.message_from_file(f)
cada_id = message['subject']
date_avis = dateparser.parse(message['date'].replace(" (CET)", "")
date_avis = dateparser.parse(message['date'].replace(" (CET)", ""))
# Extraction pièce jointe 'Avis.pdf'
pdf = None
......
......@@ -122,7 +122,7 @@ def export_pour_ta(app):
.all()
output_order = ['num', 'nom', 'sexe', 'refus', 'demande', 'bordereau',
'avis_cada']
'avis_cada', 'date_cada']
print(';'.join(output_order))
......@@ -148,5 +148,6 @@ def export_pour_ta(app):
if act.etape == ETAPE_DOC_MASQUE and \
act.attachment.startswith('avis-cada'):
data['avis_cada'] = act.attachment
data['date_cada'] = act.date.strftime('%d/%m/%Y')
print(';'.join([data.get(k, '') for k in output_order]))
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