mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-14 23:08:07 -04:00
Remove contact-list references from code
This commit is contained in:
@@ -25,14 +25,12 @@ class JobApiClient(NotifyAdminAPIClient):
|
||||
|
||||
return job
|
||||
|
||||
def get_jobs(self, service_id, *, limit_days=None, contact_list_id=None, statuses=None, page=1):
|
||||
def get_jobs(self, service_id, *, limit_days=None, statuses=None, page=1):
|
||||
params = {'page': page}
|
||||
if limit_days is not None:
|
||||
params['limit_days'] = limit_days
|
||||
if statuses is not None:
|
||||
params['statuses'] = ','.join(statuses)
|
||||
if contact_list_id is not None:
|
||||
params['contact_list_id'] = contact_list_id
|
||||
|
||||
return self.get(url='/service/{}/job'.format(service_id), params=params)
|
||||
|
||||
@@ -53,12 +51,11 @@ class JobApiClient(NotifyAdminAPIClient):
|
||||
if job['job_status'] != 'cancelled'
|
||||
)
|
||||
|
||||
def get_page_of_jobs(self, service_id, *, page, statuses=None, contact_list_id=None, limit_days=None):
|
||||
def get_page_of_jobs(self, service_id, *, page, statuses=None, limit_days=None):
|
||||
return self.get_jobs(
|
||||
service_id,
|
||||
statuses=statuses or self.NON_SCHEDULED_JOB_STATUSES,
|
||||
page=page,
|
||||
contact_list_id=contact_list_id,
|
||||
limit_days=limit_days,
|
||||
)
|
||||
|
||||
@@ -88,15 +85,12 @@ class JobApiClient(NotifyAdminAPIClient):
|
||||
def has_jobs(self, service_id):
|
||||
return bool(self.get_jobs(service_id)['data'])
|
||||
|
||||
def create_job(self, job_id, service_id, scheduled_for=None, contact_list_id=None):
|
||||
def create_job(self, job_id, service_id, scheduled_for=None):
|
||||
data = {"id": job_id}
|
||||
|
||||
if scheduled_for:
|
||||
data.update({'scheduled_for': scheduled_for})
|
||||
|
||||
if contact_list_id:
|
||||
data.update({'contact_list_id': contact_list_id})
|
||||
|
||||
data = _attach_current_user(data)
|
||||
job = self.post(url='/service/{}/job'.format(service_id), data=data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user