Fix timer action 500s after FastAPI upgrade
FastAPI 0.141 raises when response serialization hits a lazy-load (current_block.subject.options) in async context, where 0.115 silently skipped it. Eager-load Subject.options in session get/timer and the TV dashboard queries. Pin pydantic 2.13.5. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
4130467b22
commit
5a2510059d
5 files changed
+10
-4
No files matched your search
@@ -172,7 +172,7 @@ async def get_session(
|
||||
select(DailySession)
|
||||
.join(Child)
|
||||
.where(DailySession.id == session_id, Child.user_id == current_user.id)
|
||||
.options(selectinload(DailySession.current_block).selectinload(ScheduleBlock.subject))
|
||||
.options(selectinload(DailySession.current_block).selectinload(ScheduleBlock.subject).selectinload(Subject.options))
|
||||
)
|
||||
session = result.scalar_one_or_none()
|
||||
if not session:
|
||||
@@ -191,7 +191,7 @@ async def timer_action(
|
||||
select(DailySession)
|
||||
.join(Child)
|
||||
.where(DailySession.id == session_id, Child.user_id == current_user.id)
|
||||
.options(selectinload(DailySession.current_block).selectinload(ScheduleBlock.subject))
|
||||
.options(selectinload(DailySession.current_block).selectinload(ScheduleBlock.subject).selectinload(Subject.options))
|
||||
)
|
||||
session = result.scalar_one_or_none()
|
||||
if not session:
|
||||
|
||||
Reference in new issue
Block a user