Changed the scheduled_for datetime to only send and hour of a day to send.

Also expect the date being passed in is BST. The date is converted to UTC before saving. And converted to BST when returning a notification.
This commit is contained in:
Rebecca Law
2017-05-17 15:06:15 +01:00
parent 5f8338dd80
commit 973cc2c4c9
14 changed files with 64 additions and 46 deletions

View File

@@ -51,10 +51,14 @@ def get_midnight_for_day_before(date):
return get_london_midnight_in_utc(day_before)
def get_utc_time_in_bst(utc_dt):
def convert_utc_time_in_bst(utc_dt):
return pytz.utc.localize(utc_dt).astimezone(local_timezone).replace(tzinfo=None)
def convert_bst_to_utc(date):
return local_timezone.localize(date).astimezone(pytz.UTC).replace(tzinfo=None)
def get_london_month_from_utc_column(column):
"""
Where queries need to count notifications by month it needs to be