mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Don’t show cancelled jobs anywhere
The information about a job doesn’t make sense if a job is cancelled. We could change the information to reflect that the job won’t be sent/ wasn’t sent/was cancelled, but there’s nothing you can really do with this info. So instead let’s: - hide cancelled jobs from the dashboard - hide cancelled jobs from the jobs page - 404 the page if the user tries to click back enough times to hit the job page
This commit is contained in:
@@ -120,7 +120,7 @@ def get_dashboard_partials(service_id):
|
||||
job for job in jobs if job['job_status'] == 'scheduled'
|
||||
], key=lambda job: job['scheduled_for'])
|
||||
immediate_jobs = [
|
||||
job for job in jobs if job['job_status'] != 'scheduled'
|
||||
job for job in jobs if job['job_status'] not in ['scheduled', 'cancelled']
|
||||
]
|
||||
service = service_api_client.get_detailed_service(service_id)
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ def view_jobs(service_id):
|
||||
'views/jobs/jobs.html',
|
||||
jobs=add_rate_to_jobs([
|
||||
job for job in job_api_client.get_job(service_id)['data']
|
||||
if job['job_status'] != 'scheduled'
|
||||
if job['job_status'] not in ['scheduled', 'cancelled']
|
||||
])
|
||||
)
|
||||
|
||||
@@ -78,6 +78,10 @@ def view_jobs(service_id):
|
||||
def view_job(service_id, job_id):
|
||||
|
||||
job = job_api_client.get_job(service_id, job_id)['data']
|
||||
|
||||
if job['job_status'] == 'cancelled':
|
||||
abort(404)
|
||||
|
||||
filter_args = _parse_filter_args(request.args)
|
||||
filter_args['status'] = _set_status_filters(filter_args)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user