Merge branch 'master' into remove-stats-from-send

This commit is contained in:
Leo Hemsted
2016-07-29 11:08:42 +01:00
16 changed files with 127 additions and 96 deletions

View File

@@ -1,5 +1,4 @@
from notifications_python_client.base import BaseAPIClient
from notifications_python_client.errors import HTTPError
class StatisticsApiClient(BaseAPIClient):
@@ -13,15 +12,6 @@ class StatisticsApiClient(BaseAPIClient):
self.client_id = app.config['ADMIN_CLIENT_USER_NAME']
self.secret = app.config['ADMIN_CLIENT_SECRET']
def get_statistics_for_service(self, service_id, limit_days=None):
params = {}
if limit_days is not None:
params['limit_days'] = limit_days
return self.get(
url='/service/{}/notifications-statistics'.format(service_id),
params=params
)
def get_7_day_aggregate_for_service(self, service_id, date_from=None, week_count=None):
params = {}
if date_from is not None: