mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-04 08:10:00 -04:00
Use same template to validate and send notification
To be absolutely sure that we can send a message we should also validate it using the same template class that we use to render it.
This commit is contained in:
@@ -32,11 +32,10 @@ from app.dao.notifications_dao import (
|
||||
)
|
||||
|
||||
from app.v2.errors import BadRequestError
|
||||
from app.utils import get_template_instance
|
||||
|
||||
|
||||
def create_content_for_notification(template, personalisation):
|
||||
template_object = get_template_instance(template.__dict__, personalisation)
|
||||
template_object = template._as_utils_template_with_personalisation(personalisation)
|
||||
check_placeholders(template_object)
|
||||
|
||||
return template_object
|
||||
|
||||
Reference in New Issue
Block a user