mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-28 19:31:40 -05:00
Fix bug with test notifications not showing
Test notifications are only stored in the notification table, not the notification_history table. We were deciding which table to query for the platform admin stats based on the start date passed to the DAO function. This means that if the start date given was more than 7 days ago and the end date was within the last 7 days, test notifications were not being returned. We now use the end date to choose which table to query which means that test notifications always get returned when they should.
This commit is contained in:
@@ -617,7 +617,7 @@ def fetch_aggregate_stats_by_date_range_for_all_services(start_date, end_date):
|
||||
end_date = get_london_midnight_in_utc(end_date + timedelta(days=1))
|
||||
table = NotificationHistory
|
||||
|
||||
if start_date >= datetime.utcnow() - timedelta(days=7):
|
||||
if end_date >= datetime.utcnow() - timedelta(days=7):
|
||||
table = Notification
|
||||
|
||||
query = db.session.query(
|
||||
|
||||
Reference in New Issue
Block a user