From 3630896fdea0c05f7d9e17a9bb8610d18e66bc57 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 16 Jul 2024 22:05:48 -0700 Subject: [PATCH] fix(team_endpoints.py): fix check --- .gitignore | 2 ++ litellm/proxy/management_endpoints/team_endpoints.py | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8a9095b84..67aa57bb3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .venv .env +.newenv +newenv/* litellm/proxy/myenv/* litellm_uuid.txt __pycache__/ diff --git a/litellm/proxy/management_endpoints/team_endpoints.py b/litellm/proxy/management_endpoints/team_endpoints.py index 0d2fb9925..ef7893ed8 100644 --- a/litellm/proxy/management_endpoints/team_endpoints.py +++ b/litellm/proxy/management_endpoints/team_endpoints.py @@ -750,10 +750,14 @@ async def team_info( if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN.value: pass - elif user_api_key_dict.team_id or (team_id != user_api_key_dict.team_id): + elif user_api_key_dict.team_id is None or ( + team_id != user_api_key_dict.team_id + ): raise HTTPException( status_code=status.HTTP_403_FORBIDDEN, - detail="key not allowed to access this team's info", + detail="key not allowed to access this team's info. Key team_id={}, Requested team_id={}".format( + user_api_key_dict.team_id, team_id + ), ) team_info = await prisma_client.get_data(