feat(CORE-001D1): harden unit-aware workspace persistence
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import Request
|
||||
from fastapi.responses import RedirectResponse
|
||||
from nicegui import ui
|
||||
|
||||
from app.domain.backtesting_math import asset_quantity_from_floats
|
||||
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, render_workspace_recovery
|
||||
from app.services.event_comparison_ui import EventComparisonPageService
|
||||
|
||||
@@ -28,15 +27,6 @@ def _chart_options(dates: tuple[str, ...], series: tuple[dict[str, object], ...]
|
||||
}
|
||||
|
||||
|
||||
@ui.page("/event-comparison")
|
||||
def legacy_event_comparison_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}/event-comparison", status_code=307)
|
||||
_render_event_comparison_page()
|
||||
|
||||
|
||||
@ui.page("/{workspace_id}/event-comparison")
|
||||
def workspace_event_comparison_page(workspace_id: str) -> None:
|
||||
repo = get_workspace_repository()
|
||||
|
||||
Reference in New Issue
Block a user