From 35d258935ad3ddaa2a0e09c1349749bb9db8c5b6 Mon Sep 17 00:00:00 2001 From: Gros Frumos Date: Tue, 17 Mar 2026 20:18:51 +0200 Subject: [PATCH] =?UTF-8?q?KIN-103:=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA?= =?UTF-8?q?=D1=83=20worktrees=5Fenabled=20=D0=B2=20PATCH=20/api/projects/{?= =?UTF-8?q?project=5Fid}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Добавлено поле worktrees_enabled: bool | None = None в класс ProjectPatch - Добавлена проверка в has_any для обнаружения изменений - Добавлена обработка поля при преобразовании в целое число для БД DB schema и runner уже содержат поддержку worktrees_enabled. GET /api/projects/{id} возвращает поле автоматически через SELECT *. Co-Authored-By: Claude Haiku 4.5 --- web/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/api.py b/web/api.py index b6fc146..86a0a83 100644 --- a/web/api.py +++ b/web/api.py @@ -233,6 +233,7 @@ class ProjectPatch(BaseModel): execution_mode: str | None = None autocommit_enabled: bool | None = None auto_test_enabled: bool | None = None + worktrees_enabled: bool | None = None obsidian_vault_path: str | None = None deploy_command: str | None = None deploy_host: str | None = None @@ -251,7 +252,7 @@ class ProjectPatch(BaseModel): def patch_project(project_id: str, body: ProjectPatch): has_any = any([ body.execution_mode, body.autocommit_enabled is not None, - body.auto_test_enabled is not None, + body.auto_test_enabled is not None, body.worktrees_enabled is not None, body.obsidian_vault_path, body.deploy_command is not None, body.deploy_host is not None, body.deploy_path is not None, body.deploy_runtime is not None, body.deploy_restart_cmd is not None, @@ -280,6 +281,8 @@ def patch_project(project_id: str, body: ProjectPatch): fields["autocommit_enabled"] = int(body.autocommit_enabled) if body.auto_test_enabled is not None: fields["auto_test_enabled"] = int(body.auto_test_enabled) + if body.worktrees_enabled is not None: + fields["worktrees_enabled"] = int(body.worktrees_enabled) if body.obsidian_vault_path is not None: fields["obsidian_vault_path"] = body.obsidian_vault_path if body.deploy_command is not None: