mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 05:58:24 -04:00
Merge pull request #468 from alphagov/download_csv_all
Functionality added to download all on activity page. All tests passing.
This commit is contained in:
@@ -140,7 +140,14 @@ def view_notifications(service_id):
|
||||
'Next page',
|
||||
'page {}'.format(page + 1))
|
||||
if 'download' in request.args and request.args['download'] == 'csv':
|
||||
csv_content = generate_notifications_csv(notifications['notifications'])
|
||||
csv_content = generate_notifications_csv(
|
||||
notification_api_client.get_notifications_for_service(
|
||||
service_id=service_id,
|
||||
page=page,
|
||||
page_size=notifications['total'],
|
||||
template_type=filter_args.getlist('template_type') if 'template_type' in filter_args else None,
|
||||
status=filter_args.getlist('status')
|
||||
if 'status' in filter_args else ['delivered', 'failed'])['notifications'])
|
||||
return csv_content, 200, {
|
||||
'Content-Type': 'text/csv; charset=utf-8',
|
||||
'Content-Disposition': 'inline; filename="notifications.csv"'
|
||||
|
||||
Reference in New Issue
Block a user