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

@@ -1,11 +1,11 @@
import base64
import json
from datetime import datetime, timedelta
from datetime import datetime
import requests
from flask import current_app
from app.utils import get_midnight_for_day_before, get_london_midnight_in_utc, get_utc_time_in_bst
from app.utils import get_midnight_for_day_before, get_london_midnight_in_utc, convert_utc_time_in_bst
class PerformancePlatformClient:
@@ -27,7 +27,7 @@ class PerformancePlatformClient:
def send_performance_stats(self, date, channel, count, period):
if self.active:
payload = {
'_timestamp': get_utc_time_in_bst(date).isoformat(),
'_timestamp': convert_utc_time_in_bst(date).isoformat(),
'service': 'govuk-notify',
'channel': channel,
'count': count,