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:
Katie Smith
2018-06-28 15:02:19 +01:00
parent 4b030b1583
commit cbb9f71e61
2 changed files with 15 additions and 22 deletions

View File

@@ -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(