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: