From 9b4933f16bc6b381d2c68a59e7be62debb8bf20b Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 13 Apr 2016 17:05:47 +0100 Subject: [PATCH] Make activity page use new nomenclature for status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Statuses used to be: - failed - complaint - bounce - sent - delivered Now they are: - sent - sending - delivered This change broke the notifications page on the admin app. It also made me realise that we should be ignoring ‘sending’ messages in the history page—it should only show messages we’ve tried to deliver. The code for this is a bit of a bodge, but it will get things working again for now. --- app/main/views/jobs.py | 10 +++++----- app/templates/main_nav.html | 2 +- app/templates/views/notifications.html | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index cf5a3128e..08ed2285a 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -119,7 +119,7 @@ def view_notifications(service_id): service_id=service_id, page=page, template_type=filter_args.getlist('template_type') if 'template_type' in filter_args else None, - status=filter_args.getlist('status') if 'status' in filter_args else None) + status=filter_args.getlist('status') if 'status' in filter_args else ['delivered', 'failed']) view_dict = MultiDict(request.args) prev_page = None if notifications['links'].get('prev', None): @@ -157,7 +157,7 @@ def view_notifications(service_id): '.view_notifications', service_id=current_service['id'], template_type=item[1], - status=request.args.get('status', '') + status=request.args.get('status', 'delivered,failed') )] for item in [ ['Emails', 'email'], ['Text messages', 'sms'], @@ -171,9 +171,9 @@ def view_notifications(service_id): template_type=request.args.get('template_type', ''), status=item[1] )] for item in [ - ['Successful', 'sent,delivered'], - ['Failed', 'failed,complaint,bounce'], - ['Both', ''] + ['Successful', 'delivered'], + ['Failed', 'failed'], + ['Both', 'delivered,failed'] ] ] ) diff --git a/app/templates/main_nav.html b/app/templates/main_nav.html index 923aaa781..a9685cec1 100644 --- a/app/templates/main_nav.html +++ b/app/templates/main_nav.html @@ -4,7 +4,7 @@