This commit is contained in:
Rebecca Law
2020-03-16 16:45:34 +00:00
parent fa72eb651f
commit 8545b097f9
3 changed files with 2 additions and 1 deletions

View File

@@ -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()

View File

@@ -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
}) })

View File

@@ -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