mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Update service schema to add letter_logo_filename
Added the filename of a service's letter logo to the service schema. We want this in the schema so that it is possible to call `current_service.letter_logo_filename` from notifications-admin and to pass this value through to template-preview.
This commit is contained in:
@@ -205,12 +205,16 @@ class ServiceSchema(BaseSchema):
|
||||
created_by = field_for(models.Service, 'created_by', required=True)
|
||||
organisation_type = field_for(models.Service, 'organisation_type')
|
||||
dvla_organisation = field_for(models.Service, 'dvla_organisation')
|
||||
letter_logo_filename = fields.Method(method_name='get_letter_logo_filename')
|
||||
permissions = fields.Method("service_permissions")
|
||||
email_branding = field_for(models.Service, 'email_branding')
|
||||
organisation = field_for(models.Service, 'organisation')
|
||||
override_flag = False
|
||||
letter_contact_block = fields.Method(method_name="get_letter_contact")
|
||||
|
||||
def get_letter_logo_filename(self, service):
|
||||
return service.dvla_organisation.filename
|
||||
|
||||
def service_permissions(self, service):
|
||||
return [p.permission for p in service.permissions]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user