mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
Renamed some files and fixed a bug on deleting the failed notifications
This commit is contained in:
@@ -89,7 +89,7 @@ def get_notifications_for_service(service_id, page=1):
|
||||
|
||||
def delete_successful_notifications_created_more_than_a_day_ago():
|
||||
deleted = db.session.query(Notification).filter(
|
||||
Notification.created_at < datetime.utcnow() - timedelta(hours=24),
|
||||
Notification.created_at < datetime.utcnow() - timedelta(days=1),
|
||||
Notification.status == 'sent'
|
||||
).delete()
|
||||
db.session.commit()
|
||||
@@ -98,7 +98,7 @@ def delete_successful_notifications_created_more_than_a_day_ago():
|
||||
|
||||
def delete_failed_notifications_created_more_than_a_week_ago():
|
||||
deleted = db.session.query(Notification).filter(
|
||||
Notification.created_at < datetime.utcnow() - timedelta(hours=24 * 7),
|
||||
Notification.created_at < datetime.utcnow() - timedelta(days=7),
|
||||
Notification.status == 'failed'
|
||||
).delete()
|
||||
db.session.commit()
|
||||
|
||||
Reference in New Issue
Block a user