mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Revert "Ensure dao_create_template doesn't clash with new trigger"
This commit is contained in:
committed by
GitHub
parent
38fb7af2be
commit
ccfa1c8228
@@ -24,19 +24,16 @@ def dao_create_template(template):
|
||||
template.id = uuid.uuid4() # must be set now so version history model can use same id
|
||||
template.archived = False
|
||||
|
||||
# The template redacted is now being inserted via a trigger
|
||||
# this will catch any Notify templates being added by a db migration
|
||||
if not TemplateRedacted.query.filter(TemplateRedacted.template_id == template.id).first():
|
||||
redacted_dict = {
|
||||
"template": template,
|
||||
"redact_personalisation": False,
|
||||
}
|
||||
if template.created_by:
|
||||
redacted_dict.update({"updated_by": template.created_by})
|
||||
else:
|
||||
redacted_dict.update({"updated_by_id": template.created_by_id})
|
||||
redacted_dict = {
|
||||
"template": template,
|
||||
"redact_personalisation": False,
|
||||
}
|
||||
if template.created_by:
|
||||
redacted_dict.update({"updated_by": template.created_by})
|
||||
else:
|
||||
redacted_dict.update({"updated_by_id": template.created_by_id})
|
||||
|
||||
template.template_redacted = TemplateRedacted(**redacted_dict)
|
||||
template.template_redacted = TemplateRedacted(**redacted_dict)
|
||||
|
||||
db.session.add(template)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user