Don’t return jobs sent from contact lists

Now that we’re grouping jobs sent from contact lists within their
parent, they shouldn’t also be listed on the jobs page at the top level.

The jobs page uses the uploads API, not the jobs API, so this commit
makes sure that filtering is happening in the proper place.
This commit is contained in:
Chris Hill-Scott
2020-12-01 15:23:38 +00:00
parent 10e1fe6902
commit 682cbc5130
2 changed files with 13 additions and 2 deletions

View File

@@ -43,7 +43,8 @@ def dao_get_uploads_by_service_id(service_id, limit_days=None, page=1, page_size
Job.job_status.notin_([JOB_STATUS_CANCELLED, JOB_STATUS_SCHEDULED]),
func.coalesce(
Job.processing_started, Job.created_at
) >= today - func.coalesce(ServiceDataRetention.days_of_retention, 7)
) >= today - func.coalesce(ServiceDataRetention.days_of_retention, 7),
Job.contact_list_id.is_(None),
]
if limit_days is not None:
jobs_query_filter.append(Job.created_at >= midnight_n_days_ago(limit_days))