mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-15 09:42:38 -05:00
Updated the schema to return reply_to - which is the id and reply_to_text which is the contact_block
This commit is contained in:
@@ -346,7 +346,8 @@ class TemplateSchema(BaseTemplateSchema):
|
||||
|
||||
class TemplateHistorySchema(BaseSchema):
|
||||
|
||||
reply_to_text = fields.Method("get_reply_to", allow_none=True)
|
||||
reply_to = fields.Method("get_reply_to", allow_none=True)
|
||||
reply_to_text = fields.Method("get_reply_to_text", allow_none=True)
|
||||
|
||||
created_by = fields.Nested(UserSchema, only=['id', 'name', 'email_address'], dump_only=True)
|
||||
created_at = field_for(models.Template, 'created_at', format='%Y-%m-%d %H:%M:%S.%f')
|
||||
@@ -354,6 +355,9 @@ class TemplateHistorySchema(BaseSchema):
|
||||
def get_reply_to(self, template):
|
||||
return template.reply_to
|
||||
|
||||
def get_reply_to_text(self, template):
|
||||
return template.get_reply_to_text()
|
||||
|
||||
class Meta:
|
||||
model = models.TemplateHistory
|
||||
|
||||
|
||||
Reference in New Issue
Block a user