Merge pull request #2296 from alphagov/return-sent-by-in-csv

List who sent a message in CSV download
This commit is contained in:
Chris Hill-Scott
2018-09-07 13:26:10 +01:00
committed by GitHub
4 changed files with 79 additions and 34 deletions

View File

@@ -130,7 +130,7 @@ def generate_notifications_csv(**kwargs):
original_column_headers = original_upload.column_headers
fieldnames = ['Row number'] + original_column_headers + ['Template', 'Type', 'Job', 'Status', 'Time']
else:
fieldnames = ['Recipient', 'Template', 'Type', 'Job', 'Status', 'Time']
fieldnames = ['Recipient', 'Template', 'Type', 'Sent by', 'Job', 'Status', 'Time']
yield ','.join(fieldnames) + '\n'
@@ -155,7 +155,8 @@ def generate_notifications_csv(**kwargs):
notification['recipient'],
notification['template_name'],
notification['template_type'],
notification['job_name'],
notification['created_by_name'] or '',
notification['job_name'] or '',
notification['status'],
notification['created_at']
]