mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
As job update is a PUT then all non nullable fields
need to be sent with update. Also bug in not committing update fixed.
This commit is contained in:
@@ -4,13 +4,13 @@ from app.models import Job
|
||||
|
||||
def save_job(job, update_dict={}):
|
||||
if update_dict:
|
||||
update_dict.pop('id')
|
||||
update_dict.pop('service')
|
||||
update_dict.pop('template')
|
||||
update_dict.pop('id', None)
|
||||
update_dict.pop('service', None)
|
||||
update_dict.pop('template', None)
|
||||
Job.query.filter_by(id=job.id).update(update_dict)
|
||||
else:
|
||||
db.session.add(job)
|
||||
db.session.commit()
|
||||
db.session.commit()
|
||||
|
||||
|
||||
def get_job(service_id, job_id):
|
||||
|
||||
Reference in New Issue
Block a user