Merge branch 'main' of https://github.com/GSA/notifications-admin into 2214-client-side-validation

This commit is contained in:
Jonathan Bobel
2025-02-24 12:30:19 -05:00
2 changed files with 9 additions and 5 deletions

View File

@@ -65,10 +65,7 @@ def service_dashboard(service_id):
active_jobs = [job for job in job_response if job["job_status"] != "cancelled"]
sorted_jobs = sorted(active_jobs, key=lambda job: job["created_at"], reverse=True)
job_lists = [
{
**job_dict,
"finished_processing": job_is_finished(job_dict)
}
{**job_dict, "finished_processing": job_is_finished(job_dict)}
for job_dict in sorted_jobs
]
@@ -91,7 +88,7 @@ def job_is_finished(job_dict):
"technical-failure",
"temporary-failure",
"permanent-failure",
"cancelled"
"cancelled",
]
processed_count = sum(

View File

@@ -128,6 +128,13 @@ def generate_notifications_csv(**kwargs):
notifications_resp = notification_api_client.get_notifications_for_service(
**kwargs
)
# Stop if we are finished
if (
notifications_resp.get("notifications") is None
or len(notifications_resp["notifications"]) == 0
):
return
for notification in notifications_resp["notifications"]:
preferred_tz_created_at = convert_report_date_to_preferred_timezone(
notification["created_at"]