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"] 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) sorted_jobs = sorted(active_jobs, key=lambda job: job["created_at"], reverse=True)
job_lists = [ 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 for job_dict in sorted_jobs
] ]
@@ -91,7 +88,7 @@ def job_is_finished(job_dict):
"technical-failure", "technical-failure",
"temporary-failure", "temporary-failure",
"permanent-failure", "permanent-failure",
"cancelled" "cancelled",
] ]
processed_count = sum( processed_count = sum(

View File

@@ -128,6 +128,13 @@ def generate_notifications_csv(**kwargs):
notifications_resp = notification_api_client.get_notifications_for_service( notifications_resp = notification_api_client.get_notifications_for_service(
**kwargs **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"]: for notification in notifications_resp["notifications"]:
preferred_tz_created_at = convert_report_date_to_preferred_timezone( preferred_tz_created_at = convert_report_date_to_preferred_timezone(
notification["created_at"] notification["created_at"]