mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
add redact to notification with template schema.
So that when the admin gets notifications, the template they return also has a "redact_personalisation" boolean attached to it. Note, it won't do the redacting on the api - that'll be part of the admin. Under the hood, this uses an association_proxy, which is essentially black magic. But it proxies the `redact_personalisation` property of `TemplateRedacted` onto the `Template` object, so that Marshmallow can pick it up. Note: NOT currently added to NotificationWithTemplateHistory
This commit is contained in:
@@ -443,6 +443,8 @@ class Template(db.Model):
|
||||
default=NORMAL
|
||||
)
|
||||
|
||||
redact_personalisation = association_proxy('template_redacted', 'redact_personalisation')
|
||||
|
||||
def get_link(self):
|
||||
# TODO: use "/v2/" route once available
|
||||
return url_for(
|
||||
|
||||
Reference in New Issue
Block a user