mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
Use new properties of utils Templates
We’ve added some new properties to the templates in utils that we can use instead of doing weird things like `WithSubjectTemplate.__str__(another_instance)`
This commit is contained in:
@@ -10,7 +10,7 @@ from flask import (
|
||||
request)
|
||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||
from notifications_utils.pdf import extract_page_from_pdf
|
||||
from notifications_utils.template import SMSMessageTemplate, WithSubjectTemplate
|
||||
from notifications_utils.template import SMSMessageTemplate
|
||||
from requests import post as requests_post
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
|
||||
@@ -178,10 +178,7 @@ def preview_template_by_id_and_service_id(service_id, template_id):
|
||||
)
|
||||
|
||||
data['subject'] = template_object.subject
|
||||
if template_object.template_type == SMS_TYPE:
|
||||
data['content'] = str(template_object)
|
||||
else:
|
||||
data['content'] = WithSubjectTemplate.__str__(template_object)
|
||||
data['content'] = template_object.content_with_placeholders_filled_in
|
||||
|
||||
return jsonify(data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user