mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
chore: adapt to SQLModel 16 & SQLAlchemy 2.x
This commit is contained in:
parent
938c3a2349
commit
c8f6aff996
24 changed files with 120 additions and 123 deletions
|
|
@ -65,7 +65,7 @@ async def login(
|
|||
expires=int(timedelta(hours=8).total_seconds()),
|
||||
)
|
||||
|
||||
user = UserRead.from_orm(user)
|
||||
user = UserRead.model_validate(user)
|
||||
|
||||
result = {
|
||||
"user": user,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ router = APIRouter()
|
|||
@router.get("/config")
|
||||
async def config():
|
||||
config = get_learnhouse_config()
|
||||
return config.dict()
|
||||
return config.model_dump()
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ async def api_get_current_user(current_user: User = Depends(get_current_user)):
|
|||
"""
|
||||
Get current user
|
||||
"""
|
||||
return current_user.dict()
|
||||
return current_user.model_dump()
|
||||
|
||||
|
||||
@router.get("/session")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue