mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
Remove redundant conditions for update query
Filtering by ID is enough, noting the other conditions were the same between both queries.
This commit is contained in:
@@ -505,9 +505,6 @@ def dao_timeout_notifications(cutoff_time, limit=100000):
|
|||||||
).limit(limit).all()
|
).limit(limit).all()
|
||||||
|
|
||||||
Notification.query.filter(
|
Notification.query.filter(
|
||||||
Notification.created_at < cutoff_time,
|
|
||||||
Notification.status.in_(current_statuses),
|
|
||||||
Notification.notification_type.in_([SMS_TYPE, EMAIL_TYPE]),
|
|
||||||
Notification.id.in_([n.id for n in notifications]),
|
Notification.id.in_([n.id for n in notifications]),
|
||||||
).update(
|
).update(
|
||||||
{'status': new_status, 'updated_at': updated_at},
|
{'status': new_status, 'updated_at': updated_at},
|
||||||
|
|||||||
Reference in New Issue
Block a user