v1.1.51: fix seed — list/get also match global defaults (client_id='' stand='')
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ from routes.api_test import bp as api_test_bp
|
|||||||
from routes.api_scenario import bp as api_scenario_bp
|
from routes.api_scenario import bp as api_scenario_bp
|
||||||
|
|
||||||
# Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI.
|
# Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI.
|
||||||
VERSION = "1.1.50"
|
VERSION = "1.1.51"
|
||||||
|
|
||||||
app = Flask(__name__, template_folder="templates", static_folder="static")
|
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")
|
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc")
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ def list_definitions(client_id, stand):
|
|||||||
cur.execute("""
|
cur.execute("""
|
||||||
SELECT id, name, steps, version, is_active, created_at, updated_at
|
SELECT id, name, steps, version, is_active, created_at, updated_at
|
||||||
FROM scenario_definitions
|
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
|
ORDER BY name
|
||||||
""", (client_id, stand))
|
""", (client_id, stand))
|
||||||
rows = cur.fetchall()
|
rows = cur.fetchall()
|
||||||
@@ -51,7 +52,7 @@ def get_definition(def_id, client_id, stand):
|
|||||||
cur.execute("""
|
cur.execute("""
|
||||||
SELECT id, name, steps, version, is_active, created_at, updated_at, updated_by
|
SELECT id, name, steps, version, is_active, created_at, updated_at, updated_by
|
||||||
FROM scenario_definitions
|
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))
|
""", (def_id, client_id, stand))
|
||||||
row = cur.fetchone()
|
row = cur.fetchone()
|
||||||
if not row:
|
if not row:
|
||||||
|
|||||||
Reference in New Issue
Block a user