From 111c6fd93a72677b79f9a83ff0e8f3b607d786fb Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 7 Mar 2024 09:42:06 -0800 Subject: [PATCH] more fixing --- app/main/views/jobs.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index 0ef267f61..6e22a82e2 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -269,23 +269,26 @@ def get_notifications(service_id, message_type, status_override=None): # noqa def get_status_filters(service, message_type, statistics): - print(f"incoming statistics {statistics} and message_type {message_type}") if message_type is None: stats = { key: sum(statistics[message_type][key] for message_type in {"email", "sms"}) - for key in {"requested", "delivered", "failure"} + for key in {"requested", "delivered", "failed"} } else: stats = statistics[message_type] - print(f"STATS = {stats}") - stats["failed"] = stats["failure"] - stats + if stats.get("failure") is not None: + stats["failed"] = stats["failure"] + + if stats.get("pending") is None: + stats["pending"] = 0 + if stats.get("sending") is None: + stats["sending"] = 0 filters = [ # key, label, option ("requested", "total", "sending,delivered,failed"), - ("pending", "pending", "pending"), + ("sending", "pending", "pending"), ("delivered", "delivered", "delivered"), ("failed", "failed", "failed"), ]