From 3fcfdc1bce7fcfeaff4c5ae36a10eb76a5328e9b Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 1 Aug 2016 09:54:30 +0100 Subject: [PATCH] Make sending count down from total rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s weird when the sending number ramps up to ~200 or so and then just floats around as new rows are being added and older ones are being marked as delivered/failed. It’s also not great that you don’t know how many rows are in a file, if you haven’t uploaded it yourself. But the only reason you want to know this is to know how much work Notify has remaining to do. So ‘sending’ should start from the total number of rows in the file and count down. --- app/main/views/jobs.py | 2 +- app/templates/views/dashboard/_jobs.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index 648fb5c21..1fc897f9a 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -293,7 +293,7 @@ def _get_job_counts(job, help_argument): [ 'Sending', 'sending', ( - job.get('notifications_sent', 0) - + job.get('notification_count', 0) - job.get('notifications_delivered', 0) - job.get('notifications_failed', 0) ) diff --git a/app/templates/views/dashboard/_jobs.html b/app/templates/views/dashboard/_jobs.html index b414e4456..0a2b3a2f7 100644 --- a/app/templates/views/dashboard/_jobs.html +++ b/app/templates/views/dashboard/_jobs.html @@ -23,7 +23,7 @@ {% endcall %} {% call field() %} {{ big_number( - item.get('notifications_sent', 0) - item.get('notifications_delivered', 0) - item.get('notifications_failed', 0), + item.get('notification_count', 0) - item.get('notifications_delivered', 0) - item.get('notifications_failed', 0), smallest=True ) }} {% endcall %}