update notification_history table from notification_dao create/update functions

please ensure that any changes to notifications table happen through either dao_create_notification or dao_update_notification.
changed the notification status update triggered by the provider callbacks to ensure that sets updated_by and can update the history table.
also re-added the character_count so we can reconstruct billing data if needed.
This commit is contained in:
Leo Hemsted
2016-07-11 16:48:32 +01:00
parent 722699a72a
commit 4ef084464d
7 changed files with 140 additions and 117 deletions

View File

@@ -17,6 +17,7 @@ from app.models import (
ApiKey,
Template,
Job,
NotificationHistory,
Notification,
Permission,
User,
@@ -97,6 +98,7 @@ def delete_service_and_all_associated_db_objects(service):
_delete_commit(Permission.query.filter_by(service=service))
_delete_commit(ApiKey.query.filter_by(service=service))
_delete_commit(ApiKey.get_history_model().query.filter_by(service_id=service.id))
_delete_commit(NotificationHistory.query.filter_by(service=service))
_delete_commit(Notification.query.filter_by(service=service))
_delete_commit(Job.query.filter_by(service=service))
_delete_commit(Template.query.filter_by(service=service))