From 06a4101940fae7540923a4fbe38221f908954b1e Mon Sep 17 00:00:00 2001 From: Cristobal Aguirre <34848638+jcaguirre89@users.noreply.github.com> Date: Fri, 7 Feb 2020 17:28:45 -0300 Subject: [PATCH] :bug: Fix typo in `read_item` GET view (#74) --- .../backend/app/app/api/api_v1/endpoints/items.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/items.py b/{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/items.py index f4db9d99ce1..bddb4723752 100644 --- a/{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/items.py +++ b/{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/items.py @@ -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, @@ -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