mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Don't fallback to dvla_organisation if letter branding unset
The template preview app now accepts a null value for the `filename` parameter. If a service doesn't have a letter branding option set, previously we defaulted to their dvla_organisation (probably HM Government). Now, we pass through None, so that we generate letters without any logo or branding.
This commit is contained in:
@@ -52,13 +52,10 @@ 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=letter_logo_file_name,
|
||||
filename=notification.service.letter_branding and notification.service.letter_branding.filename,
|
||||
values=notification.personalisation
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user