Task is the same whether job based or not

- use notification to build action
- notification has job
- based in encrypted blob
This commit is contained in:
Martyn Inglis
2016-02-23 17:39:08 +00:00
parent 635debb5a6
commit 201c2d01ba
5 changed files with 32 additions and 9 deletions

View File

@@ -41,12 +41,12 @@ def get_job_for_service(service_id, job_id=None):
if job_id:
try:
job = get_job(service_id, job_id)
if not job:
return jsonify(result="error", message="Job not found"), 404
data, errors = job_schema.dump(job)
return jsonify(data=data)
except DataError:
return jsonify(result="error", message="Invalid job id"), 400
except NoResultFound:
return jsonify(result="error", message="Job not found"), 404
else:
jobs = get_jobs_by_service(service_id)
data, errors = jobs_schema.dump(jobs)