From 86a4daa4e8d75507d84481a8821c7da1d4f11f75 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 18 Jul 2016 09:04:43 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20pass=20entire=20job=20thru=20to?= =?UTF-8?q?=20notifications=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It only needs the `id`, and it only needs that to generate the download URL, so let’s just pass the URL through instead. --- app/main/views/jobs.py | 9 ++++++--- app/templates/partials/jobs/notifications.html | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index e1baa38c4..4df9fa983 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -299,7 +299,6 @@ def get_job_partials(job): filter_args = _parse_filter_args(request.args) _set_status_filters(filter_args) - return { 'counts': render_template( 'partials/jobs/count.html', @@ -309,11 +308,15 @@ def get_job_partials(job): ), 'notifications': render_template( 'partials/jobs/notifications.html', - job=job, notifications=notification_api_client.get_notifications_for_service( job['service'], job['id'], status=filter_args.get('status') )['notifications'], - status=request.args.get('status', ''), + download_link=url_for( + '.view_job_csv', + service_id=current_service['id'], + job_id=job['id'], + status=request.args.get('status', '') + ), help=get_help_argument() ), 'status': render_template( diff --git a/app/templates/partials/jobs/notifications.html b/app/templates/partials/jobs/notifications.html index c3d26fc72..f81fe5a9d 100644 --- a/app/templates/partials/jobs/notifications.html +++ b/app/templates/partials/jobs/notifications.html @@ -6,7 +6,7 @@ {% if notifications and not help %}

- Download this report + Download this reportAvailable for 7 days