Change get_financial_year to return ending date as 1 microsecond earlier.

That way we can write the queries as between start and end dates, making it easier to read.
This makes more sense.
This commit is contained in:
Rebecca Law
2017-05-02 10:00:47 +01:00
parent 88d92d6070
commit 3e0221adec
5 changed files with 13 additions and 17 deletions

View File

@@ -250,8 +250,7 @@ def get_notification_billable_unit_count_per_month(service_id, year):
).filter(
NotificationHistory.billable_units != 0,
NotificationHistory.service_id == service_id,
NotificationHistory.created_at >= start_date,
NotificationHistory.created_at < end_date
NotificationHistory.created_at.between(start_date, end_date)
).group_by(
month
).order_by(