Merge pull request #2193 from alphagov/fix-failed-statuses

Add new failed stats to statistic counts
This commit is contained in:
Rebecca Law
2018-11-01 13:19:10 +00:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -83,7 +83,9 @@ def _update_statuses_from_row(update_dict, row):
update_dict['requested'] += row.count
if row.status in ('delivered', 'sent'):
update_dict['delivered'] += row.count
elif row.status in ('failed', 'technical-failure', 'temporary-failure', 'permanent-failure'):
elif row.status in (
'failed', 'technical-failure', 'temporary-failure',
'permanent-failure', 'validation-failed', 'virus-scan-failed'):
update_dict['failed'] += row.count

View File

@@ -35,7 +35,10 @@ NewStatsRow = collections.namedtuple('row', ('notification_type', 'status', 'key
StatsRow('email', 'technical-failure', 1),
StatsRow('email', 'temporary-failure', 1),
StatsRow('email', 'permanent-failure', 1),
], [4, 0, 4], [0, 0, 0], [0, 0, 0]),
StatsRow('letter', 'validation-failed', 1),
StatsRow('letter', 'virus-scan-failed', 1),
StatsRow('letter', 'permanent-failure', 1),
], [4, 0, 4], [0, 0, 0], [3, 0, 3]),
'convert_sent_to_delivered': ([
StatsRow('sms', 'sending', 1),
StatsRow('sms', 'delivered', 1),