mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Reduced the size of the pull request by only dealing with adding the data retention form.
This commit is contained in:
@@ -265,8 +265,7 @@ def get_notifications(service_id, message_type, status_override=None):
|
||||
status_filters=get_status_filters(
|
||||
current_service,
|
||||
message_type,
|
||||
service_api_client.get_service_statistics(service_id,
|
||||
limit_days=current_app.config['ACTIVITY_STATS_LIMIT_DAYS'])
|
||||
service_api_client.get_service_statistics(service_id, today_only=False)
|
||||
)
|
||||
),
|
||||
'notifications': render_template(
|
||||
|
||||
@@ -511,7 +511,7 @@ def _check_messages(service_id, template_id, upload_id, preview_row, letters_as_
|
||||
users = user_api_client.get_users_for_service(service_id=service_id)
|
||||
|
||||
statistics = service_api_client.get_service_statistics(service_id, today_only=True)
|
||||
remaining_messages = (current_service['message_limit'] - sum(stat['requested'] for stat in statistics.values()))
|
||||
remaining_messages = (current_service.message_limit - sum(stat['requested'] for stat in statistics.values()))
|
||||
|
||||
contents = s3download(service_id, upload_id)
|
||||
|
||||
|
||||
@@ -41,14 +41,8 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
"""
|
||||
return self.get('/service/{0}'.format(service_id))
|
||||
|
||||
# def get_service_statistics(self, service_id, today_only):
|
||||
# return self.get('/service/{0}/statistics'.format(service_id), params={'today_only': today_only})['data']
|
||||
|
||||
def get_service_statistics(self, service_id, limit_days=7):
|
||||
return self.get('/service/{0}/statistics'.format(service_id), params={'limit_days': limit_days})['data']
|
||||
|
||||
def get_service_statistics_for_today(self, service_id):
|
||||
return self.get('/service/{0}/statistics'.format(service_id), params={'today_only': True})['data']
|
||||
def get_service_statistics(self, service_id, today_only):
|
||||
return self.get('/service/{0}/statistics'.format(service_id), params={'today_only': today_only})['data']
|
||||
|
||||
def get_services(self, params_dict=None):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user