Skip to content

Commit ebf6b06

Browse files
authored
Merge pull request #185 from blackyau/main
bugfix: ensure user lookup returns model instance in write_post endpoint
2 parents 01632e2 + a67585c commit ebf6b06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/api/v1/posts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ async def write_post(
2424
current_user: Annotated[dict, Depends(get_current_user)],
2525
db: Annotated[AsyncSession, Depends(async_get_db)],
2626
) -> PostRead:
27-
db_user = await crud_users.get(db=db, username=username, is_deleted=False, schema_to_select=UserRead)
27+
db_user = await crud_users.get(db=db, username=username, is_deleted=False, schema_to_select=UserRead,
28+
return_as_model=True)
2829
if db_user is None:
2930
raise NotFoundException("User not found")
3031

0 commit comments

Comments
 (0)