mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
[WIP]
This commit is contained in:
@@ -126,6 +126,7 @@ def dao_get_future_scheduled_job_by_id_and_service_id(job_id, service_id):
|
|||||||
def dao_create_job(job):
|
def dao_create_job(job):
|
||||||
if not job.id:
|
if not job.id:
|
||||||
job.id = uuid.uuid4()
|
job.id = uuid.uuid4()
|
||||||
|
|
||||||
db.session.add(job)
|
db.session.add(job)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,6 @@ def create_job(service_id):
|
|||||||
raise InvalidRequest("Create job is not allowed: service is inactive ", 403)
|
raise InvalidRequest("Create job is not allowed: service is inactive ", 403)
|
||||||
|
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
|
|
||||||
data.update({
|
data.update({
|
||||||
"service": service_id
|
"service": service_id
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -381,6 +381,7 @@ class JobSchema(BaseSchema):
|
|||||||
ServiceSchema, attribute="service", dump_to="service_name", only=["name"], dump_only=True)
|
ServiceSchema, attribute="service", dump_to="service_name", only=["name"], dump_only=True)
|
||||||
|
|
||||||
template_type = fields.Method('get_template_type', dump_only=True)
|
template_type = fields.Method('get_template_type', dump_only=True)
|
||||||
|
contact_list_id = field_for(models.Job, 'contact_list_id')
|
||||||
|
|
||||||
def get_template_type(self, job):
|
def get_template_type(self, job):
|
||||||
return job.template.template_type
|
return job.template.template_type
|
||||||
|
|||||||
Reference in New Issue
Block a user