mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
fix name of download file
This commit is contained in:
@@ -11,12 +11,7 @@ from flask import (
|
|||||||
url_for,
|
url_for,
|
||||||
)
|
)
|
||||||
|
|
||||||
from app import (
|
from app import current_service, job_api_client, notification_api_client
|
||||||
current_service,
|
|
||||||
format_date_numeric,
|
|
||||||
job_api_client,
|
|
||||||
notification_api_client,
|
|
||||||
)
|
|
||||||
from app.main import main
|
from app.main import main
|
||||||
from app.notify_client.api_key_api_client import KEY_TYPE_TEST
|
from app.notify_client.api_key_api_client import KEY_TYPE_TEST
|
||||||
from app.utils import (
|
from app.utils import (
|
||||||
@@ -146,6 +141,8 @@ def download_notifications_csv(service_id):
|
|||||||
service_data_retention_days = current_service.get_days_of_retention(
|
service_data_retention_days = current_service.get_days_of_retention(
|
||||||
filter_args.get("message_type")[0]
|
filter_args.get("message_type")[0]
|
||||||
)
|
)
|
||||||
|
file_time = datetime.now().strftime("%Y-%m-%d %I:%M:%S %p")
|
||||||
|
|
||||||
return Response(
|
return Response(
|
||||||
stream_with_context(
|
stream_with_context(
|
||||||
generate_notifications_csv(
|
generate_notifications_csv(
|
||||||
@@ -162,7 +159,7 @@ def download_notifications_csv(service_id):
|
|||||||
mimetype="text/csv",
|
mimetype="text/csv",
|
||||||
headers={
|
headers={
|
||||||
"Content-Disposition": 'inline; filename="{} - {} - {} report.csv"'.format(
|
"Content-Disposition": 'inline; filename="{} - {} - {} report.csv"'.format(
|
||||||
format_date_numeric(datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%fZ")),
|
file_time,
|
||||||
filter_args["message_type"][0],
|
filter_args["message_type"][0],
|
||||||
current_service.name,
|
current_service.name,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user