feat(CORE-001D1): harden unit-aware workspace persistence

This commit is contained in:
Bu5hm4nn
2026-03-25 13:19:33 +01:00
parent cfb6abd842
commit 132aaed512
13 changed files with 464 additions and 87 deletions

View File

@@ -1,10 +1,9 @@
from __future__ import annotations
from fastapi import Request
from fastapi.responses import RedirectResponse
from nicegui import ui
from app.models.workspace import WORKSPACE_COOKIE, get_workspace_repository
from app.models.workspace import get_workspace_repository
from app.pages.common import (
dashboard_page,
demo_spot_price,
@@ -57,15 +56,6 @@ def _waterfall_options(metrics: dict) -> dict:
}
@ui.page("/hedge")
def legacy_hedge_page(request: Request):
repo = get_workspace_repository()
workspace_id = request.cookies.get(WORKSPACE_COOKIE, "")
if workspace_id and repo.workspace_exists(workspace_id):
return RedirectResponse(url=f"/{workspace_id}/hedge", status_code=307)
_render_hedge_page()
@ui.page("/{workspace_id}/hedge")
def workspace_hedge_page(workspace_id: str) -> None:
repo = get_workspace_repository()