Merge pull request #2810 from alphagov/fix_preview

Fix bug where preview for templated letters would not show
This commit is contained in:
Pea M. Tyczynska
2020-04-20 15:49:36 +01:00
committed by GitHub
3 changed files with 6 additions and 3 deletions

View File

@@ -89,7 +89,8 @@ def create_letters_pdf(self, notification_id):
def get_letters_pdf(template, contact_block, filename, values):
template_for_letter_print = {
"subject": template.subject,
"content": template.content
"content": template.content,
"template_type": template.template_type
}
data = {

View File

@@ -288,7 +288,8 @@ def preview_letter_template_by_notification_id(service_id, notification_id, file
"id": str(notification.template_id),
"subject": template.subject,
"content": template.content,
"version": str(template.version)
"version": str(template.version),
"template_type": template.template_type
}
service = dao_fetch_service_by_id(service_id)

View File

@@ -82,7 +82,8 @@ def test_get_letters_pdf_calls_notifications_template_preview_service_correctly(
'filename': filename,
'template': {
'subject': sample_letter_template.subject,
'content': sample_letter_template.content
'content': sample_letter_template.content,
'template_type': sample_letter_template.template_type
}
}