mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 02:23:19 -04:00
move job statuses to job_api_client
prevent code duplication and a good excuse to use set subtraction
This commit is contained in:
@@ -67,12 +67,7 @@ def _set_status_filters(filter_args):
|
||||
def view_jobs(service_id):
|
||||
page = int(request.args.get('page', 1))
|
||||
# all but scheduled and cancelled
|
||||
statuses_to_display = [
|
||||
'pending',
|
||||
'in progress',
|
||||
'finished',
|
||||
'sending limits exceeded',
|
||||
]
|
||||
statuses_to_display = job_api_client.JOB_STATUSES - {'scheduled', 'cancelled'}
|
||||
jobs_response = job_api_client.get_jobs(service_id, statuses=statuses_to_display, page=page)
|
||||
jobs = [
|
||||
add_rate_to_job(job) for job in jobs_response['data']
|
||||
|
||||
Reference in New Issue
Block a user