From 51e99bd82821129309ed96dbb23fa24e417d43fd Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 19 Jun 2020 10:32:44 +0100 Subject: [PATCH] Ask API for less detailed JSON for all templates This should speed things up by: - less time waiting for big blobs of JSON to come from Redis or the API - less time spent deserialising big blobs of JSON --- app/notify_client/service_api_client.py | 2 +- tests/app/notify_client/test_service_api_client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/notify_client/service_api_client.py b/app/notify_client/service_api_client.py index 1747a171f..a596c0bf1 100644 --- a/app/notify_client/service_api_client.py +++ b/app/notify_client/service_api_client.py @@ -276,7 +276,7 @@ class ServiceAPIClient(NotifyAdminAPIClient): """ Retrieve all templates for service. """ - endpoint = '/service/{service_id}/template'.format( + endpoint = '/service/{service_id}/template?detailed=False'.format( service_id=service_id) return self.get(endpoint) diff --git a/tests/app/notify_client/test_service_api_client.py b/tests/app/notify_client/test_service_api_client.py index d3de2c0cf..e84294009 100644 --- a/tests/app/notify_client/test_service_api_client.py +++ b/tests/app/notify_client/test_service_api_client.py @@ -275,7 +275,7 @@ def test_client_returns_count_of_service_templates( ], None, [ - call('/service/{}/template'.format(SERVICE_ONE_ID)) + call('/service/{}/template?detailed=False'.format(SERVICE_ONE_ID)) ], [ call(