Make missing personalisation error consistent

In other places the text we use for this error message is "Missing personalisation: name, date, thing". See:
- 72b108b694/app/template/rest.py (L125)
- 717c0510a3/app/notifications/rest.py (L206)
- 05a179c6ef/app/v2/template/post_template.py (L38)

For some reason this part of the codebase says "Template missing personalisation: …". This is inconsistent, and also confusing because it’s the API call that’s missing the personalisation, not the template itself. 

This commit changes the error message to be consistent with the majority of the codebase, which uses the less confusing wording.
This commit is contained in:
Chris Hill-Scott
2017-10-23 14:41:49 +01:00
committed by GitHub
parent c9a7ee991e
commit 5b3e77ba87

View File

@@ -31,7 +31,7 @@ def create_content_for_notification(template, personalisation):
def check_placeholders(template_object):
if template_object.missing_data:
message = 'Template missing personalisation: {}'.format(", ".join(template_object.missing_data))
message = 'Missing personalisation: {}'.format(", ".join(template_object.missing_data))
raise BadRequestError(fields=[{'template': message}], message=message)