mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
Don’t pass entire job thru to notifications page
It only needs the `id`, and it only needs that to generate the download URL, so let’s just pass the URL through instead.
This commit is contained in:
@@ -299,7 +299,6 @@ def get_job_partials(job):
|
|||||||
|
|
||||||
filter_args = _parse_filter_args(request.args)
|
filter_args = _parse_filter_args(request.args)
|
||||||
_set_status_filters(filter_args)
|
_set_status_filters(filter_args)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'counts': render_template(
|
'counts': render_template(
|
||||||
'partials/jobs/count.html',
|
'partials/jobs/count.html',
|
||||||
@@ -309,11 +308,15 @@ def get_job_partials(job):
|
|||||||
),
|
),
|
||||||
'notifications': render_template(
|
'notifications': render_template(
|
||||||
'partials/jobs/notifications.html',
|
'partials/jobs/notifications.html',
|
||||||
job=job,
|
|
||||||
notifications=notification_api_client.get_notifications_for_service(
|
notifications=notification_api_client.get_notifications_for_service(
|
||||||
job['service'], job['id'], status=filter_args.get('status')
|
job['service'], job['id'], status=filter_args.get('status')
|
||||||
)['notifications'],
|
)['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()
|
help=get_help_argument()
|
||||||
),
|
),
|
||||||
'status': render_template(
|
'status': render_template(
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
{% if notifications and not help %}
|
{% if notifications and not help %}
|
||||||
<p class="bottom-gutter">
|
<p class="bottom-gutter">
|
||||||
<a href="{{ url_for('.view_job_csv', service_id=current_service.id, job_id=job.id, status=status) }}" download="download" class="heading-small">Download this report</a>
|
<a href="{{ download_link }}" download="download" class="heading-small">Download this report</a>
|
||||||
 
|
 
|
||||||
<span id="time-left">Available for 7 days</span>
|
<span id="time-left">Available for 7 days</span>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user