mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 08:16:51 -04:00
Put data from job on job page
The main change is showing the finished time if the job is finished, rather than the start time.
This commit is contained in:
@@ -42,23 +42,26 @@ def view_job(service_id, job_id):
|
||||
try:
|
||||
job = job_api_client.get_job(service_id, job_id)['data']
|
||||
notifications = notification_api_client.get_notifications_for_service(service_id, job_id)
|
||||
finished = job['status'] == 'finished'
|
||||
return render_template(
|
||||
'views/job.html',
|
||||
notifications=notifications['notifications'],
|
||||
counts={
|
||||
'total': len(notifications),
|
||||
'delivered': len(notifications),
|
||||
'queued': 0 if finished else job['notification_count'],
|
||||
'sent': job['notification_count'] if finished else 0,
|
||||
'failed': 0
|
||||
},
|
||||
uploaded_at=job['created_at'],
|
||||
finished_at=job['updated_at'] if finished else None,
|
||||
cost=u'£0.00',
|
||||
uploaded_file_name=job['original_file_name'],
|
||||
uploaded_file_time=job['created_at'],
|
||||
template=Template(
|
||||
templates_dao.get_service_template_or_404(service_id, job['template'])['data'],
|
||||
prefix=service['name']
|
||||
),
|
||||
service_id=service_id,
|
||||
service=service
|
||||
from_name=service['name'],
|
||||
job_id=job_id
|
||||
)
|
||||
except HTTPError as e:
|
||||
if e.status_code == 404:
|
||||
|
||||
Reference in New Issue
Block a user