Fixed bug where I forgot to update only the right job :-(

This commit is contained in:
Martyn Inglis
2016-03-04 15:54:43 +00:00
parent c44aaf0fdc
commit ae395b490e
2 changed files with 34 additions and 1 deletions

View File

@@ -6,7 +6,9 @@ from sqlalchemy import desc
def dao_create_notification(notification):
if notification.job_id:
db.session.query(Job).update({Job.notifications_sent: Job.notifications_sent + 1})
db.session.query(Job).filter_by(
id=notification.job_id
).update({Job.notifications_sent: Job.notifications_sent + 1})
db.session.add(notification)
db.session.commit()