mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-05 08:40:29 -04:00
Merge pull request #1839 from alphagov/make-service-stats-7-days-max
Adjust get_service_stats to get counts for a maximum of 7 days ago
This commit is contained in:
@@ -251,7 +251,9 @@ def delete_service_and_all_associated_db_objects(service):
|
||||
|
||||
@statsd(namespace="dao")
|
||||
def dao_fetch_stats_for_service(service_id):
|
||||
return _stats_for_service_query(service_id).all()
|
||||
return _stats_for_service_query(service_id).filter(
|
||||
func.date(Notification.created_at) >= date.today() - timedelta(days=7)
|
||||
).all()
|
||||
|
||||
|
||||
@statsd(namespace="dao")
|
||||
|
||||
Reference in New Issue
Block a user