Skip to content

Commit

Permalink
🐛 Fix typo in read_item GET view (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaguirre89 authored Feb 7, 2020
1 parent 141f6cd commit dc712ac
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def update_item(


@router.get("/{id}", response_model=Item)
def read_user_me(
def read_item(
*,
db: Session = Depends(get_db),
id: int,
Expand All @@ -79,7 +79,7 @@ def read_user_me(
"""
item = crud.item.get(db_session=db, id=id)
if not item:
raise HTTPException(status_code=400, detail="Item not found")
raise HTTPException(status_code=404, detail="Item not found")
if not crud.user.is_superuser(current_user) and (item.owner_id != current_user.id):
raise HTTPException(status_code=400, detail="Not enough permissions")
return item
Expand Down

0 comments on commit dc712ac

Please sign in to comment.