Show sent, not pending numbers on the dashboard

The dashboard should only talk about notifications that are *successful* or
*failed*. It should not count notifications that are still queued.

This will stop:
- a situation like ‘0 emails, 14.1% failed’
- the big numbers and the template statistics numbers not adding up to
  the same total
This commit is contained in:
Chris Hill-Scott
2016-04-27 12:25:08 +01:00
parent 4da63f2876
commit 00507fc7be
2 changed files with 15 additions and 10 deletions

View File

@@ -13,9 +13,9 @@
<div class="grid-row bottom-gutter">
<div class="column-half">
{{ big_number_with_status(
statistics.get('emails_delivered', 0),
'email' if statistics.get('emails_delivered') == 1 else 'emails',
statistics.get('emails_failed'),
statistics.emails_sent,
'email' if statistics.emails_sent == 1 else 'emails',
statistics.emails_failed,
statistics.get('emails_failure_rate', 0.0),
statistics.get('emails_failure_rate', 0)|float > 3,
failure_link=url_for(".view_notifications", service_id=current_service.id, template_type='email', status='failed')
@@ -23,9 +23,9 @@
</div>
<div class="column-half">
{{ big_number_with_status(
statistics.get('sms_requested', 0),
'text message' if statistics.get('sms_requested') == 1 else 'text messages',
statistics.get('sms_failed'),
statistics.sms_sent,
'text message' if statistics.sms_sent == 1 else 'text messages',
statistics.sms_failed,
statistics.get('sms_failure_rate', 0.0),
statistics.get('sms_failure_rate', 0)|float > 3,
failure_link=url_for(".view_notifications", service_id=current_service.id, template_type='sms', status='failed')