Skip to content

Commit da5a92d

Browse files
Refactor user deletion logic in users.py
1 parent bba8d07 commit da5a92d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

backend/app/api/routes/users.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ def delete_user(
225225
raise HTTPException(
226226
status_code=403, detail="Super users are not allowed to delete themselves"
227227
)
228-
statement = delete(Item).where(col(Item.owner_id) == user_id)
229-
session.exec(statement)
228+
230229
session.delete(user)
231230
session.commit()
232231
return Message(message="User deleted successfully")

0 commit comments

Comments
 (0)