mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Merge pull request #853 from alphagov/ignore-additional-personalisation
Quietly ignore extra personalisation
This commit is contained in:
@@ -23,11 +23,6 @@ def check_placeholders(template_object):
|
||||
message = 'Template missing personalisation: {}'.format(", ".join(template_object.missing_data))
|
||||
raise BadRequestError(fields=[{'template': message}], message=message)
|
||||
|
||||
if template_object.additional_data:
|
||||
message = 'Template personalisation not needed for template: {}'.format(
|
||||
", ".join(template_object.additional_data))
|
||||
raise BadRequestError(fields=[{'template': message}], message=message)
|
||||
|
||||
|
||||
def persist_notification(template_id,
|
||||
template_version,
|
||||
|
||||
@@ -309,11 +309,6 @@ def create_template_object_for_notification(template, personalisation):
|
||||
errors = {'template': [message]}
|
||||
raise InvalidRequest(errors, status_code=400)
|
||||
|
||||
if template_object.additional_data:
|
||||
message = 'Personalisation not needed for template: {}'.format(", ".join(template_object.additional_data))
|
||||
errors = {'template': [message]}
|
||||
raise InvalidRequest(errors, status_code=400)
|
||||
|
||||
if (
|
||||
template_object.template_type == SMS_TYPE and
|
||||
template_object.content_count > current_app.config.get('SMS_CHAR_COUNT_LIMIT')
|
||||
|
||||
@@ -101,13 +101,6 @@ def preview_template_by_id_and_service_id(service_id, template_id):
|
||||
]}, status_code=400
|
||||
)
|
||||
|
||||
if template_object.additional_data:
|
||||
raise InvalidRequest(
|
||||
{'template': [
|
||||
'Personalisation not needed for template: {}'.format(", ".join(template_object.additional_data))
|
||||
]}, status_code=400
|
||||
)
|
||||
|
||||
data['subject'], data['content'] = template_object.subject, str(template_object)
|
||||
|
||||
return jsonify(data)
|
||||
|
||||
Reference in New Issue
Block a user