fix(team_endpoints.py): fix check

This commit is contained in:
Krrish Dholakia 2024-07-16 22:05:48 -07:00
parent ee33a80486
commit 3630896fde
2 changed files with 8 additions and 2 deletions

2
.gitignore vendored
View file

@ -1,5 +1,7 @@
.venv
.env
.newenv
newenv/*
litellm/proxy/myenv/*
litellm_uuid.txt
__pycache__/

View file

@ -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(