Skip to content

Commit

Permalink
fix: scalar_one_or_none in detail
Browse files Browse the repository at this point in the history
  • Loading branch information
sfrvn committed Oct 15, 2024
1 parent 6a9f92c commit eb1afb1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fastapi_sqlalchemy_toolkit/model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ async def get(

result = await session.execute(stmt)
if base_stmt is None:
return result.scalars().first()
if order_by is not None:
return result.scalars().first()
return result.scalar_one_or_none()
return result.first()

async def get_or_404(
Expand Down

0 comments on commit eb1afb1

Please sign in to comment.