mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Add formatted notification status to CSV
This commit makes the CSV download use the same language for failure reasons as the frontend. It also adds a test around this stuff, which was patchily tested before.
This commit is contained in:
@@ -89,7 +89,7 @@ def get_errors_for_csv(recipients, template_type):
|
||||
|
||||
|
||||
def generate_notifications_csv(json_list):
|
||||
from app import format_datetime
|
||||
from app import format_datetime, format_notification_status
|
||||
content = StringIO()
|
||||
retval = None
|
||||
with content as csvfile:
|
||||
@@ -102,7 +102,7 @@ def generate_notifications_csv(json_list):
|
||||
x['template']['name'],
|
||||
x['template']['template_type'],
|
||||
x['job']['original_file_name'] if x['job'] else '',
|
||||
x['status'],
|
||||
format_notification_status(x['status'], x['template']['template_type']),
|
||||
format_datetime(x['created_at'])])
|
||||
retval = content.getvalue()
|
||||
return retval
|
||||
|
||||
Reference in New Issue
Block a user