v1.1.51: fix seed — list/get also match global defaults (client_id='' stand='')

This commit is contained in:
2026-07-30 15:25:16 +04:00
parent 983b387708
commit 6f051aa348
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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")
+3 -2
View File
@@ -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: