Limit jobs sent from contact list by data retention

On the uploads page we only show jobs which are within a service’s data
retention.

This commit does the same for when we’re listing the jobs for a contact
list. This matches the UI, which says a contact list has been ‘used
`<count_of_jobs>` in the last <data_retention> days’
This commit is contained in:
Chris Hill-Scott
2020-12-01 13:34:31 +00:00
parent 4b2744b684
commit b579f68411
7 changed files with 27 additions and 5 deletions

View File

@@ -137,11 +137,12 @@ class ContactList(JSONModel):
file_name, extention = path.splitext(self.original_file_name)
return f'{file_name}.csv'
def get_jobs(self, *, page):
def get_jobs(self, *, page, limit_days=None):
return PaginatedJobsAndScheduledJobs(
self.service_id,
contact_list_id=self.id,
page=page,
limit_days=limit_days,
)