mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 23:43:12 -04:00
Put real notifications on job page
This commit is contained in:
@@ -10,7 +10,7 @@ from flask_login import login_required
|
||||
from notifications_python_client.errors import HTTPError
|
||||
from utils.template import Template
|
||||
|
||||
from app import job_api_client
|
||||
from app import job_api_client, notification_api_client
|
||||
from app.main import main
|
||||
from app.main.dao import templates_dao
|
||||
from app.main.dao import services_dao
|
||||
@@ -41,18 +41,14 @@ def view_job(service_id, job_id):
|
||||
service = services_dao.get_service_by_id_or_404(service_id)
|
||||
try:
|
||||
job = job_api_client.get_job(service_id, job_id)['data']
|
||||
messages = []
|
||||
notifications = notification_api_client.get_notifications_for_service(service_id, job_id)
|
||||
return render_template(
|
||||
'views/job.html',
|
||||
messages=messages,
|
||||
notifications=notifications['notifications'],
|
||||
counts={
|
||||
'total': len(messages),
|
||||
'delivered': len([
|
||||
message for message in messages if message['status'] == 'Delivered'
|
||||
]),
|
||||
'failed': len([
|
||||
message for message in messages if message['status'] == 'Failed'
|
||||
])
|
||||
'total': len(notifications),
|
||||
'delivered': len(notifications),
|
||||
'failed': 0
|
||||
},
|
||||
cost=u'£0.00',
|
||||
uploaded_file_name=job['original_file_name'],
|
||||
|
||||
Reference in New Issue
Block a user