re-add content_char_count to public GET /notification endpoints

we shouldn't remove stuff from endpoints or we'll break clients
This commit is contained in:
Leo Hemsted
2016-08-09 17:28:55 +01:00
parent 4e01277318
commit 5b7af00295
2 changed files with 8 additions and 1 deletions

View File

@@ -308,8 +308,13 @@ class NotificationWithPersonalisationSchema(NotificationWithTemplateSchema):
renderer=PassThrough()
)
in_data['body'] = template.replaced
if in_data['template']['template_type'] == 'email':
template_type = in_data['template']['template_type']
if template_type == 'email':
in_data['subject'] = template.replaced_subject
in_data['content_char_count'] = None
else:
in_data['content_char_count'] = len(in_data['body'])
in_data.pop('personalisation', None)
in_data['template'].pop('content', None)
in_data['template'].pop('subject', None)