🐛 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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user