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.models.portfolio import PortfolioConfig
|
||||
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
|
||||
from app.services.alerts import AlertService, build_portfolio_alert_context
|
||||
from app.services.settings_status import save_status_text
|
||||
@@ -35,15 +34,6 @@ def _render_workspace_recovery() -> None:
|
||||
)
|
||||
|
||||
|
||||
@ui.page("/settings")
|
||||
def legacy_settings_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}/settings", status_code=307)
|
||||
return RedirectResponse(url="/", status_code=307)
|
||||
|
||||
|
||||
@ui.page("/{workspace_id}/settings")
|
||||
def settings_page(workspace_id: str) -> None:
|
||||
"""Settings page with workspace-scoped persistent portfolio configuration."""
|
||||
|
||||
Reference in New Issue
Block a user