🐛 Handle non-existing user IDs in read_user_by_id (#1396)

Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
This commit is contained in:
Saltie
2026-01-22 13:37:57 +01:00
committed by GitHub
parent fe3bafc6f6
commit 4cab9e972f
2 changed files with 35 additions and 3 deletions

View File

@@ -170,6 +170,8 @@ def read_user_by_id(
status_code=403,
detail="The user doesn't have enough privileges",
)
if user is None:
raise HTTPException(status_code=404, detail="User not found")
return user