From 6f051aa3488aecf8e0c95f82082c8d2208c1d5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Thu, 30 Jul 2026 15:25:16 +0400 Subject: [PATCH] =?UTF-8?q?v1.1.51:=20fix=20seed=20=E2=80=94=20list/get=20?= =?UTF-8?q?also=20match=20global=20defaults=20(client=5Fid=3D''=20stand=3D?= =?UTF-8?q?'')?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/app.py | 2 +- site/db/scenario_defs.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/site/app.py b/site/app.py index ad58f38..6b0eb70 100644 --- a/site/app.py +++ b/site/app.py @@ -18,7 +18,7 @@ from routes.api_test import bp as api_test_bp from routes.api_scenario import bp as api_scenario_bp # Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI. -VERSION = "1.1.50" +VERSION = "1.1.51" app = Flask(__name__, template_folder="templates", static_folder="static") app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc") diff --git a/site/db/scenario_defs.py b/site/db/scenario_defs.py index de9f7e7..3233ed1 100644 --- a/site/db/scenario_defs.py +++ b/site/db/scenario_defs.py @@ -23,7 +23,8 @@ def list_definitions(client_id, stand): cur.execute(""" SELECT id, name, steps, version, is_active, created_at, updated_at FROM scenario_definitions - WHERE client_id = %s AND stand = %s AND is_active = TRUE + WHERE is_active = TRUE + AND ((client_id = %s AND stand = %s) OR (client_id = '' AND stand = '')) ORDER BY name """, (client_id, stand)) rows = cur.fetchall() @@ -51,7 +52,7 @@ def get_definition(def_id, client_id, stand): cur.execute(""" SELECT id, name, steps, version, is_active, created_at, updated_at, updated_by FROM scenario_definitions - WHERE id = %s AND client_id = %s AND stand = %s + WHERE id = %s AND ((client_id = %s AND stand = %s) OR (client_id = '' AND stand = '')) """, (def_id, client_id, stand)) row = cur.fetchone() if not row: