fix(internal_user_endpoints.py): return all teams if user is admin

This commit is contained in:
Krrish Dholakia 2024-08-10 16:36:43 -07:00
parent 0b8cade30d
commit 259ca15d7b
3 changed files with 31 additions and 8 deletions

View file

@ -316,7 +316,7 @@ async def user_info(
## GET USER ROW ##
if user_id is not None:
user_info = await prisma_client.get_data(user_id=user_id)
elif view_all == True:
elif view_all is True:
if page is None:
page = 0
if page_size is None:
@ -364,11 +364,7 @@ async def user_info(
getattr(caller_user_info, "user_role", None)
== LitellmUserRoles.PROXY_ADMIN
):
teams_2 = await prisma_client.get_data(
table_name="team",
query_type="find_all",
team_id_list=None,
)
teams_2 = await prisma_client.db.litellm_teamtable.find_many()
else:
teams_2 = await prisma_client.get_data(
team_id_list=caller_user_info.teams,