feat(CORE-001D1): harden unit-aware workspace persistence
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user