mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-23 11:01:59 -05:00
Use the letter_branding logo if it exists otherwise fall back to the dvla_organisation logo.
This commit is contained in:
@@ -52,11 +52,13 @@ from app.models import (
|
||||
def create_letters_pdf(self, notification_id):
|
||||
try:
|
||||
notification = get_notification_by_id(notification_id, _raise=True)
|
||||
|
||||
# We only need this while we are migrating to the new letter_branding model
|
||||
letter_logo_file_name = notification.service.letter_branding.filename if notification.service.letter_branding\
|
||||
else notification.service.dvla_organisation.filename
|
||||
pdf_data, billable_units = get_letters_pdf(
|
||||
notification.template,
|
||||
contact_block=notification.reply_to_text,
|
||||
filename=notification.service.dvla_organisation.filename,
|
||||
filename=letter_logo_file_name,
|
||||
values=notification.personalisation
|
||||
)
|
||||
|
||||
|
||||
@@ -274,13 +274,15 @@ def preview_letter_template_by_notification_id(service_id, notification_id, file
|
||||
}
|
||||
|
||||
service = dao_fetch_service_by_id(service_id)
|
||||
|
||||
# We only need this while we are migrating to the new letter_branding model
|
||||
letter_logo_filename = service.letter_branding.filename if service.letter_branding \
|
||||
else service.dvla_organisation.filename
|
||||
data = {
|
||||
'letter_contact_block': notification.reply_to_text,
|
||||
'template': template_for_letter_print,
|
||||
'values': notification.personalisation,
|
||||
'date': notification.created_at.isoformat(),
|
||||
'filename': service.dvla_organisation.filename,
|
||||
'filename': letter_logo_filename,
|
||||
}
|
||||
|
||||
url = '{}/preview.{}{}'.format(
|
||||
|
||||
Reference in New Issue
Block a user