Added service and template relationship to notification model.

This makes it more consistent with other model classes with respect
to marhmallow serialisation/deserialisation.
This commit is contained in:
Adam Shimali
2016-02-09 12:48:27 +00:00
parent d24a356205
commit e5e049d735
4 changed files with 15 additions and 14 deletions

View File

@@ -6,8 +6,8 @@ def save_notification(notification, update_dict={}):
if update_dict:
update_dict.pop('id', None)
update_dict.pop('job', None)
update_dict.pop('service_id', None)
update_dict.pop('template_id', None)
update_dict.pop('service', None)
update_dict.pop('template', None)
Notification.query.filter_by(id=notification.id).update(update_dict)
else:
db.session.add(notification)