mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
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:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user