mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
Add reply_to in the template schema
This commit is contained in:
@@ -315,11 +315,14 @@ class BaseTemplateSchema(BaseSchema):
|
|||||||
reply_to = fields.Method("get_reply_to", allow_none=True)
|
reply_to = fields.Method("get_reply_to", allow_none=True)
|
||||||
|
|
||||||
def get_reply_to(self, template):
|
def get_reply_to(self, template):
|
||||||
|
if template.template_type == 'letter':
|
||||||
|
text = template.get_reply_to_text()
|
||||||
|
return text
|
||||||
return template.reply_to
|
return template.reply_to
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.Template
|
model = models.Template
|
||||||
exclude = ("service_id", "jobs", "service_letter_contact_id")
|
exclude = ("service_id", "jobs")
|
||||||
strict = True
|
strict = True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ def get_template_by_id_and_service_id(service_id, template_id):
|
|||||||
def preview_template_by_id_and_service_id(service_id, template_id):
|
def preview_template_by_id_and_service_id(service_id, template_id):
|
||||||
fetched_template = dao_get_template_by_id_and_service_id(template_id=template_id, service_id=service_id)
|
fetched_template = dao_get_template_by_id_and_service_id(template_id=template_id, service_id=service_id)
|
||||||
data = template_schema.dump(fetched_template).data
|
data = template_schema.dump(fetched_template).data
|
||||||
|
print(data)
|
||||||
template_object = get_template_instance(data, values=request.args.to_dict())
|
template_object = get_template_instance(data, values=request.args.to_dict())
|
||||||
|
|
||||||
if template_object.missing_data:
|
if template_object.missing_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user