From 2be3db10d98780f9dbc059854e1bf18fbaa47fbc Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 7 Mar 2024 10:25:11 -0800 Subject: [PATCH] fix the right way --- app/main/views/jobs.py | 5 +---- tests/app/main/views/test_activity.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index 3f48cb9ec..774f2a916 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -280,10 +280,7 @@ def get_status_filters(service, message_type, statistics): 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 + stats["pending"] = stats["requested"] - stats["delivered"] - stats["failed"] filters = [ # key, label, option diff --git a/tests/app/main/views/test_activity.py b/tests/app/main/views/test_activity.py index 936bfac80..e224c2e7d 100644 --- a/tests/app/main/views/test_activity.py +++ b/tests/app/main/views/test_activity.py @@ -531,7 +531,7 @@ def test_time_left(job_created_at, expected_message): assert get_time_left(job_created_at) == expected_message -STATISTICS = {"sms": {"requested": 6, "failed": 2, "delivered": 1, "pending": 3}} +STATISTICS = {"sms": {"requested": 6, "failed": 2, "delivered": 1}} def test_get_status_filters_calculates_stats(client_request):