From 661caad8fb88572bc007566ed084741ae91c1583 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 10 Jul 2024 12:30:25 -0300 Subject: [PATCH] Fix/update template schema (#2214) * fix: add template_category_id to template schema * fix: consider template_category_id when deciding if a template has changed --- app/schemas.py | 1 + app/template/rest.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/schemas.py b/app/schemas.py index e66c2cc73d..9cf0669bbf 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -397,6 +397,7 @@ class TemplateSchema(BaseTemplateSchema): is_precompiled_letter = fields.Method("get_is_precompiled_letter") process_type = field_for(models.Template, "process_type") template_category = fields.Nested(TemplateCategorySchema, dump_only=True) + template_category_id = fields.UUID(required=False, allow_none=True) redact_personalisation = fields.Method("redact") created_at = FlexibleDateTime() updated_at = FlexibleDateTime() diff --git a/app/template/rest.py b/app/template/rest.py index 4e376351c8..f582ad7628 100644 --- a/app/template/rest.py +++ b/app/template/rest.py @@ -273,7 +273,7 @@ def get_template_versions(service_id, template_id): def _template_has_not_changed(current_data, updated_template): return all( current_data[key] == updated_template[key] - for key in ("name", "content", "subject", "archived", "process_type", "postage") + for key in ("name", "content", "subject", "archived", "process_type", "postage", "template_category_id") )