mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
Don’t return letter contact blocks in service JSON
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:
2f1e8b104b/app/models/service.py (L349-L351)
Removing this from the response means one fewer database query.
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user