Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 64836de

Browse files
committed
Fix: one_or_none throws an exception on mult rows
This is not a replacement for first()
1 parent 96feb5e commit 64836de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bookserver/crud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ async def fetch_one_user_topic_practice(
10741074
async with async_session() as session:
10751075
res = await session.execute(query)
10761076
rslogger.debug(f"{res=}")
1077-
utp = res.scalars().one_or_none()
1077+
utp = res.scalars().first()
10781078
return UserTopicPracticeValidator.from_orm(utp)
10791079

10801080

0 commit comments

Comments
 (0)