mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
fix core daos
This commit is contained in:
@@ -466,7 +466,7 @@ def dao_timeout_notifications(cutoff_time, limit=100000):
|
|||||||
update(Notification)
|
update(Notification)
|
||||||
.filter(Notification.id.in_([n.id for n in notifications]))
|
.filter(Notification.id.in_([n.id for n in notifications]))
|
||||||
.values(
|
.values(
|
||||||
{"status": new_status, "updated_at": updated_at}, synchronize_session=False
|
{"status": new_status, "updated_at": updated_at}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
db.session.execute(stmt)
|
db.session.execute(stmt)
|
||||||
@@ -482,16 +482,16 @@ def dao_update_notifications_by_reference(references, update_dict):
|
|||||||
.filter(Notification.reference.in_(references))
|
.filter(Notification.reference.in_(references))
|
||||||
.values(update_dict)
|
.values(update_dict)
|
||||||
)
|
)
|
||||||
updated_count = db.stmt.execute(stmt)
|
updated_count = db.session.execute(stmt)
|
||||||
|
|
||||||
updated_history_count = 0
|
updated_history_count = 0
|
||||||
if updated_count != len(references):
|
if updated_count != len(references):
|
||||||
stmt = (
|
stmt = (
|
||||||
select(NotificationHistory)
|
select(NotificationHistory)
|
||||||
.filter(NotificationHistory.reference.in_(references))
|
.filter(NotificationHistory.reference.in_(references))
|
||||||
.values(update_dict, synchronize_session=False)
|
.values(update_dict)
|
||||||
)
|
)
|
||||||
updated_history_count = db.stmt.execute(stmt)
|
updated_history_count = db.session.execute(stmt)
|
||||||
|
|
||||||
return updated_count, updated_history_count
|
return updated_count, updated_history_count
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user