Use new properties of utils Templates

We’ve added some new properties to the templates in utils that we can
use instead of doing weird things like
`WithSubjectTemplate.__str__(another_instance)`
This commit is contained in:
Chris Hill-Scott
2020-04-13 13:48:23 +01:00
parent ee25dc79e4
commit 5ddb5a75da
10 changed files with 28 additions and 57 deletions

View File

@@ -521,7 +521,7 @@ class NotificationWithPersonalisationSchema(NotificationWithTemplateSchema):
def handle_template_merge(self, in_data):
in_data['template'] = in_data.pop('template_history')
template = get_template_instance(in_data['template'], in_data['personalisation'])
in_data['body'] = str(template)
in_data['body'] = template.content_with_placeholders_filled_in
if in_data['template']['template_type'] != models.SMS_TYPE:
in_data['subject'] = template.subject
in_data['content_char_count'] = None