Use PassThrough renderer

Implements and depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/49
This commit is contained in:
Chris Hill-Scott
2016-07-07 15:59:50 +01:00
parent d28775800c
commit a8a556d02a
6 changed files with 16 additions and 9 deletions

View File

@@ -24,6 +24,8 @@ from notifications_utils.recipients import (
validate_and_format_phone_number
)
from notifications_utils.renderers import PassThrough
from app import ma
from app import models
from app.dao.permissions_dao import permission_dao
@@ -272,7 +274,11 @@ class NotificationStatusSchema(BaseSchema):
@post_dump
def handle_template_merge(self, in_data):
from notifications_utils.template import Template
template = Template(in_data['template'], in_data['personalisation'])
template = Template(
in_data['template'],
in_data['personalisation'],
renderer=PassThrough()
)
in_data['body'] = template.replaced
if in_data['template']['template_type'] == 'email':
in_data['subject'] = template.replaced_subject