diff --git a/app/dao/services_dao.py b/app/dao/services_dao.py index a29dd464a..ba3dbf717 100644 --- a/app/dao/services_dao.py +++ b/app/dao/services_dao.py @@ -455,7 +455,6 @@ def dao_fetch_stats_for_service_from_days(service_id, start_date, end_date): start_date = get_midnight_in_utc(start_date) end_date = get_midnight_in_utc(end_date + timedelta(days=1)) - # Subquery for daily total notifications total_substmt = ( select( func.date_trunc("day", NotificationAllTimeView.created_at).label("day"), @@ -478,7 +477,6 @@ def dao_fetch_stats_for_service_from_days(service_id, start_date, end_date): .subquery() ) - # Query for daily total notifications total_stmt = select( total_substmt.c.day, func.sum(total_substmt.c.notification_count).label("total_notifications"), @@ -486,12 +484,10 @@ def dao_fetch_stats_for_service_from_days(service_id, start_date, end_date): total_substmt.c.day ) - # Execute both queries total_notifications = { row.day: row.total_notifications for row in db.session.execute(total_stmt).all() } - # Query for breakdown by notification type and status stmt = ( select( NotificationAllTimeView.notification_type, diff --git a/app/service/rest.py b/app/service/rest.py index 748da7df1..718e3bd33 100644 --- a/app/service/rest.py +++ b/app/service/rest.py @@ -687,7 +687,6 @@ def get_single_month_notification_stats_for_service(service_id): month_year = datetime(year, month, 10, 00, 00, 00) start_date, end_date = get_month_start_and_end_date_in_utc(month_year) - # First element is total notifications used elsewhere. __, results = dao_fetch_stats_for_service_from_days( service_id, start_date, end_date )