use new letter branding instead of dvla organisation id

new code is copied stylistically from the email branding patterns.
Instead of `service.dvla_organisation`, there's now
`service.letter_branding` and `service.letter_branding_id`. However,
unlike email branding we're not currently showing a preview of the
logo. That can come later when we work out how we want to do it.
This commit is contained in:
Leo Hemsted
2019-02-01 16:34:54 +00:00
parent 0e20ca44a3
commit a1caf77b0e
7 changed files with 49 additions and 19 deletions

View File

@@ -28,6 +28,7 @@ class Service():
'email_from',
'id',
'inbound_api',
'letter_branding',
'letter_contact_block',
'letter_logo_filename',
'message_limit',
@@ -303,11 +304,15 @@ class Service():
return email_branding_client.get_email_branding(self.email_branding_id)['email_branding']
return None
@property
def letter_branding_id(self):
return self._dict['letter_branding']
@cached_property
def letter_branding(self):
return letter_branding_client.get_letter_branding().get(
self.dvla_organisation, '001'
)
if self.letter_branding_id:
return letter_branding_client.get_letter_branding(self.letter_branding_id)
return None
@cached_property
def organisation_name(self):