From 0d2060fcfacc44b682a9c7c9a52829b165a6beec Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 22 Jun 2020 09:51:59 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20return=20letter=20contact=20blo?= =?UTF-8?q?cks=20in=20service=20JSON?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The admin app doesn’t use them: https://github.com/alphagov/notifications-admin/search?q=letter_contact_block&unscoped_q=letter_contact_block Instead it requests them separately when needed: https://github.com/alphagov/notifications-admin/blob/2f1e8b104b0f8c76e14ba0d0159d0fcaf95a7046/app/models/service.py#L349-L351 Removing this from the response means one fewer database query. --- app/schemas.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/schemas.py b/app/schemas.py index c985d1812..b1e41de52 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -205,7 +205,6 @@ class ServiceSchema(BaseSchema): email_branding = field_for(models.Service, 'email_branding') organisation = field_for(models.Service, 'organisation') override_flag = False - letter_contact_block = fields.Method(serialize="get_letter_contact") go_live_at = field_for(models.Service, 'go_live_at', format=DATETIME_FORMAT_NO_TIMEZONE) def get_letter_logo_filename(self, service): @@ -219,7 +218,6 @@ class ServiceSchema(BaseSchema): class Meta: model = models.Service - dump_only = ['letter_contact_block'] exclude = ( 'updated_at', 'created_at',