mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
fix(templates): Database error detected when saving a template with a disk image change
This commit is contained in:
1 parent
13d1563762
commit
da3a34144b
3 files changed
+9
-3
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user