fix(templates): Database error detected when saving a template with a disk image change

This commit is contained in:
Cristi committed 2026-06-06 14:21:15 +03:00
1 parent 13d1563762
commit da3a34144b
3 files changed
+9 -3

No files matched your search

+5 -1
View File
@@ -267,9 +267,13 @@ class TemplatesService:
raise ControllerNotFoundError(f"Template '{template_id}' not found")
return template
async def _remove_image(self, template_id: UUID, image_path:str) -> None:
async def _remove_image(self, template_id: UUID, image_path: str) -> None:
if not image_path:
return
image = await self._templates_repo.get_image(image_path)
if image is None:
return
await self._templates_repo.remove_image_from_template(template_id, image)
async def update_template(self, template_id: UUID, template_update: schemas.TemplateUpdate) -> dict: