mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-06 18:38:26 -04:00
Update method to delete notifications that are a week old, to look at the days of retention set for the service.
If the service does not have the days of retention set, then use 7 days. Added a method to get days of retention for a service and notificaiton type
This commit is contained in:
@@ -20,6 +20,14 @@ def fetch_service_data_retention(service_id):
|
||||
return data_retention_list
|
||||
|
||||
|
||||
def fetch_service_data_retention_by_notification_type(service_id, notification_type):
|
||||
data_retention_list = ServiceDataRetention.query.filter_by(
|
||||
service_id=service_id,
|
||||
notification_type=notification_type
|
||||
).first()
|
||||
return data_retention_list
|
||||
|
||||
|
||||
@transactional
|
||||
def insert_service_data_retention(service_id, notification_type, days_of_retention):
|
||||
new_data_retention = ServiceDataRetention(service_id=service_id,
|
||||
|
||||
Reference in New Issue
Block a user