Remove redundant filters in timeout update query

These aren't necessary since we're locking the set of notifications
to update, which are queried using the same filters.
This commit is contained in:
Ben Thorner
2021-11-22 12:41:26 +00:00
parent b4a68ada2d
commit 59bbb4f8b7

View File

@@ -474,9 +474,6 @@ def _timeout_notifications(current_statuses, new_status, timeout_start, updated_
).all()
Notification.query.filter(
Notification.created_at < timeout_start,
Notification.status.in_(current_statuses),
Notification.notification_type.in_([SMS_TYPE, EMAIL_TYPE]),
Notification.id.in_([n.id for n in notifications]),
).update(
{'status': new_status, 'updated_at': updated_at},