Fix bug with missing template version param

We were asking for the latest version of a letter template rather than
the version that the notification was sent with. This mean that if you
previewed a letter and had made edits to the template since it was sent
you would be shown an incorrect preview.
This commit is contained in:
David McDonald
2020-08-17 12:25:45 +01:00
parent f1940cbd30
commit 7b5f4ad156
2 changed files with 47 additions and 3 deletions

View File

@@ -243,8 +243,7 @@ def preview_letter_template_by_notification_id(service_id, notification_id, file
page = request.args.get('page')
notification = get_notification_by_id(notification_id)
template = dao_get_template_by_id(notification.template_id)
template = dao_get_template_by_id(notification.template_id, notification.template_version)
metadata = {}
if template.is_precompiled_letter: