Add updated history count to dao_update_notifications_by_reference

For returned letter updates most notifications won't exist in the
notifications table, so in order to find out whether the reference
matches any known letters we need to check the count of updated
history records.
This commit is contained in:
Alexey Bezhan
2018-08-30 14:27:57 +01:00
parent 0dcf04def9
commit 18ab7f3337
4 changed files with 25 additions and 15 deletions

View File

@@ -465,14 +465,14 @@ def dao_update_notifications_by_reference(references, update_dict):
synchronize_session=False
)
NotificationHistory.query.filter(
updated_history_count = NotificationHistory.query.filter(
NotificationHistory.reference.in_(references)
).update(
update_dict,
synchronize_session=False
)
return updated_count
return updated_count, updated_history_count
@statsd(namespace="dao")