mirror of
https://github.com/rommapp/romm.git
synced 2026-12-02 10:08:40 +01:00
- Introduced `ui_settings` column in the users table via Alembic migration. - Updated UserForm and UserSchema models to include `ui_settings`. - Enhanced user update endpoint to handle `ui_settings`. - Created a new composable `useUISettings` for managing UI settings with local storage. - Refactored UI components to utilize the new `useUISettings` for theme and language settings.
39 lines
898 B
Python
39 lines
898 B
Python
from datetime import datetime
|
|
from typing import NotRequired, TypedDict, get_type_hints
|
|
|
|
from handler.metadata.ra_handler import RAUserProgression
|
|
from models.user import Role
|
|
|
|
from .base import BaseModel
|
|
|
|
RAProgression = TypedDict( # type: ignore[misc]
|
|
"RAProgression",
|
|
{k: NotRequired[v] for k, v in get_type_hints(RAUserProgression).items()}, # type: ignore[misc]
|
|
total=False,
|
|
)
|
|
|
|
|
|
class UserSchema(BaseModel):
|
|
id: int
|
|
username: str
|
|
email: str | None
|
|
enabled: bool
|
|
role: Role
|
|
oauth_scopes: list[str]
|
|
avatar_path: str
|
|
last_login: datetime | None
|
|
last_active: datetime | None
|
|
ra_username: str | None = None
|
|
ra_progression: RAProgression | None = None
|
|
ui_settings: dict | None = None
|
|
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class InviteLinkSchema(BaseModel):
|
|
token: str
|