Admin-Plattform für die Tenants von Onyscribe: Editor mit Live-Vorschau (echter Core in Sandbox), Versionen, KI-Agent (Cortecs), OIDC-Abgleich über die Login-Developer-API, Deploy-Engine (Mittwald, gesperrt ohne DEPLOY_LIVE, Freigabe pro Tenant), Core-Vertrag (Schema/Manifest), Core-Releases mit Kompatibilitätsprüfung, Canary-Rollout und Rollback, Zustandsabgleich. Runbook: docs/RUNBOOK_PARALLELTEST.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
33 lines
788 B
Python
33 lines
788 B
Python
from __future__ import annotations
|
||
|
||
from datetime import datetime
|
||
from zoneinfo import ZoneInfo
|
||
|
||
from fastapi.templating import Jinja2Templates
|
||
|
||
from app.settings import APP_NAME, ROOT
|
||
|
||
templates = Jinja2Templates(directory=str(ROOT / "app" / "templates"))
|
||
BERLIN = ZoneInfo("Europe/Berlin")
|
||
|
||
|
||
def dt(value: datetime | None, fmt: str = "%d.%m.%Y %H:%M") -> str:
|
||
if not value:
|
||
return "–"
|
||
if value.tzinfo is None:
|
||
from datetime import timezone
|
||
value = value.replace(tzinfo=timezone.utc)
|
||
return value.astimezone(BERLIN).strftime(fmt)
|
||
|
||
|
||
templates.env.filters["dt"] = dt
|
||
templates.env.globals["APP_NAME"] = APP_NAME
|
||
|
||
|
||
def _live() -> bool:
|
||
from app.services import deploy
|
||
return deploy.live_enabled()
|
||
|
||
|
||
templates.env.globals["deploy_live"] = _live
|