Add broadcast channel to service schema

This will show which channel is configured, if any, for a service. It
mimics what we are doing for the `allowed_broadcast_provider`.
This commit is contained in:
David McDonald
2021-02-03 16:43:01 +00:00
parent d9cba06017
commit 5d62647b9d
2 changed files with 6 additions and 0 deletions

View File

@@ -236,10 +236,14 @@ class ServiceSchema(BaseSchema, UUIDsAsStringsMixin):
override_flag = False
go_live_at = field_for(models.Service, 'go_live_at', format=DATETIME_FORMAT_NO_TIMEZONE)
allowed_broadcast_provider = fields.Method(dump_only=True, serialize='_get_allowed_broadcast_provider')
broadcast_channel = fields.Method(dump_only=True, serialize='_get_broadcast_channel')
def _get_allowed_broadcast_provider(self, service):
return service.allowed_broadcast_provider
def _get_broadcast_channel(self, service):
return service.broadcast_channel
def get_letter_logo_filename(self, service):
return service.letter_branding and service.letter_branding.filename