@@ -50,7 +50,7 @@ def read_item(session: SessionDep, current_user: CurrentUser, id: uuid.UUID) ->
50
50
if not item :
51
51
raise HTTPException (status_code = 404 , detail = "Item not found" )
52
52
if not current_user .is_superuser and (item .owner_id != current_user .id ):
53
- raise HTTPException (status_code = 400 , detail = "Not enough permissions" )
53
+ raise HTTPException (status_code = 403 , detail = "Not enough permissions" )
54
54
return item
55
55
56
56
@@ -83,7 +83,7 @@ def update_item(
83
83
if not item :
84
84
raise HTTPException (status_code = 404 , detail = "Item not found" )
85
85
if not current_user .is_superuser and (item .owner_id != current_user .id ):
86
- raise HTTPException (status_code = 400 , detail = "Not enough permissions" )
86
+ raise HTTPException (status_code = 403 , detail = "Not enough permissions" )
87
87
update_dict = item_in .model_dump (exclude_unset = True )
88
88
item .sqlmodel_update (update_dict )
89
89
session .add (item )
@@ -103,7 +103,7 @@ def delete_item(
103
103
if not item :
104
104
raise HTTPException (status_code = 404 , detail = "Item not found" )
105
105
if not current_user .is_superuser and (item .owner_id != current_user .id ):
106
- raise HTTPException (status_code = 400 , detail = "Not enough permissions" )
106
+ raise HTTPException (status_code = 403 , detail = "Not enough permissions" )
107
107
session .delete (item )
108
108
session .commit ()
109
109
return Message (message = "Item deleted successfully" )
0 commit comments