mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
Update Notification schema to preserve template_history attribute
`Notification.template_history` relationship has been removed but we want to keep the `template_history` key in existing notification serializations, so we serialize it from `Notifications.template`. This keeps the data format the same, but both `template` and `template_history` keys will now contain data from the `TemplateHistory` instance.
This commit is contained in:
@@ -450,7 +450,7 @@ class NotificationWithTemplateSchema(BaseSchema):
|
||||
|
||||
|
||||
class NotificationWithPersonalisationSchema(NotificationWithTemplateSchema):
|
||||
template_history = fields.Nested(TemplateHistorySchema,
|
||||
template_history = fields.Nested(TemplateHistorySchema, attribute="template",
|
||||
only=['id', 'name', 'template_type', 'content', 'subject', 'version'],
|
||||
dump_only=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user