BUILD138 — исправление 500 в справочнике стадионов
This commit is contained in:
2
app.py
2
app.py
@@ -29,7 +29,7 @@ from ui_builder import install_ui_builder
|
|||||||
from khl_site.khl_data_center import APP as khl_site_app
|
from khl_site.khl_data_center import APP as khl_site_app
|
||||||
|
|
||||||
BASE_DIR = Path(__file__).resolve().parent
|
BASE_DIR = Path(__file__).resolve().parent
|
||||||
BUILD_VERSION = "2026.09.15.5"
|
BUILD_VERSION = "2026.09.15.6"
|
||||||
# compatibility: BUILD_VERSION = "2026.08.26.1"
|
# compatibility: BUILD_VERSION = "2026.08.26.1"
|
||||||
# compatibility: BUILD_VERSION = "2026.08.25.1"
|
# compatibility: BUILD_VERSION = "2026.08.25.1"
|
||||||
# compatibility: BUILD_VERSION = "2026.08.24.15"
|
# compatibility: BUILD_VERSION = "2026.08.24.15"
|
||||||
|
|||||||
@@ -867,6 +867,13 @@ class HockeyDataService:
|
|||||||
if row is None:
|
if row is None:
|
||||||
row = Stadium(external_id=identity, source=str(source or "stat2tv")[:32], active=True)
|
row = Stadium(external_id=identity, source=str(source or "stat2tv")[:32], active=True)
|
||||||
session.add(row)
|
session.add(row)
|
||||||
|
# BUILD138: HockeyDatabase intentionally uses autoflush=False.
|
||||||
|
# Flush a newly created stadium immediately so another game in the
|
||||||
|
# same sync transaction can find the same external_id instead of
|
||||||
|
# creating a duplicate pending row and failing the UNIQUE constraint
|
||||||
|
# on commit. Stadium has no FK dependencies, so a targeted flush is
|
||||||
|
# safe and avoids flushing unrelated match-sync changes.
|
||||||
|
session.flush([row])
|
||||||
|
|
||||||
manual = str(row.source or "").casefold() == "manual"
|
manual = str(row.source or "").casefold() == "manual"
|
||||||
for field, value in values.items():
|
for field, value in values.items():
|
||||||
|
|||||||
Reference in New Issue
Block a user