mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 19:03:30 -05:00
flake8
This commit is contained in:
@@ -103,7 +103,16 @@ class JobApiClient(NotifyAdminAPIClient):
|
||||
|
||||
return scheduled_for
|
||||
|
||||
def create_job(self, job_id, service_id, scheduled_for=None):
|
||||
def create_job(
|
||||
self,
|
||||
job_id,
|
||||
service_id,
|
||||
scheduled_for=None,
|
||||
template_id=None,
|
||||
original_file_name=None,
|
||||
notification_count=None,
|
||||
valid=None,
|
||||
):
|
||||
data = {"id": job_id}
|
||||
|
||||
# make a datetime object in the user's preferred timezone
|
||||
@@ -112,6 +121,15 @@ class JobApiClient(NotifyAdminAPIClient):
|
||||
scheduled_for = JobApiClient.convert_user_time_to_utc(scheduled_for)
|
||||
data.update({"scheduled_for": scheduled_for})
|
||||
|
||||
if template_id:
|
||||
data.update({"template_id": template_id})
|
||||
if original_file_name:
|
||||
data.update({"original_file_name": original_file_name})
|
||||
if notification_count:
|
||||
data.update({"notification_count": notification_count})
|
||||
if valid:
|
||||
data.update({"valid": valid})
|
||||
|
||||
data = _attach_current_user(data)
|
||||
job = self.post(url="/service/{}/job".format(service_id), data=data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user