Skip to content

Commit

Permalink
Fix/update template schema (#2214)
Browse files Browse the repository at this point in the history
* fix: add template_category_id to template schema

* fix: consider template_category_id when deciding if a template has changed
  • Loading branch information
andrewleith authored Jul 10, 2024
1 parent cbccbb1 commit 661caad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion app/template/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)


Expand Down

0 comments on commit 661caad

Please sign in to comment.