From e3a79e80c90657a882c142cfddd860771187a38b Mon Sep 17 00:00:00 2001 From: Pea Tyczynska Date: Tue, 8 Jan 2019 17:50:34 +0000 Subject: [PATCH 1/2] Cancelled notifications don't show as failures in statistics --- app/service/statistics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/service/statistics.py b/app/service/statistics.py index e1ed57aeb..3d22b20d6 100644 --- a/app/service/statistics.py +++ b/app/service/statistics.py @@ -86,7 +86,7 @@ def _update_statuses_from_row(update_dict, row): update_dict['delivered'] += row.count elif row.status in ( 'failed', 'technical-failure', 'temporary-failure', - 'permanent-failure', 'validation-failed', 'virus-scan-failed', 'cancelled'): + 'permanent-failure', 'validation-failed', 'virus-scan-failed'): update_dict['failed'] += row.count From e179e1e4a44db4078a48b3f5b8fff4e01466024c Mon Sep 17 00:00:00 2001 From: Pea Tyczynska Date: Wed, 9 Jan 2019 13:30:28 +0000 Subject: [PATCH 2/2] Update test --- tests/app/service/test_statistics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app/service/test_statistics.py b/tests/app/service/test_statistics.py index 6ba357d3b..b1a341c8f 100644 --- a/tests/app/service/test_statistics.py +++ b/tests/app/service/test_statistics.py @@ -39,7 +39,7 @@ NewStatsRow = collections.namedtuple('row', ('notification_type', 'status', 'key StatsRow('letter', 'virus-scan-failed', 1), StatsRow('letter', 'permanent-failure', 1), StatsRow('letter', 'cancelled', 1), - ], [4, 0, 4], [0, 0, 0], [4, 0, 4]), + ], [4, 0, 4], [0, 0, 0], [4, 0, 3]), 'convert_sent_to_delivered': ([ StatsRow('sms', 'sending', 1), StatsRow('sms', 'delivered', 1),