mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
Merge pull request #3219 from BerriAI/litellm_ui_show_teams_ui
[UI-Fix] Show all teams on Admin UI
This commit is contained in:
commit
dbb06141a3
2 changed files with 14 additions and 5 deletions
|
|
@ -5911,11 +5911,18 @@ async def user_info(
|
|||
user_id=user_api_key_dict.user_id
|
||||
)
|
||||
# *NEW* get all teams in user 'teams' field
|
||||
teams_2 = await prisma_client.get_data(
|
||||
team_id_list=caller_user_info.teams,
|
||||
table_name="team",
|
||||
query_type="find_all",
|
||||
)
|
||||
if getattr(caller_user_info, "user_role", None) == "proxy_admin":
|
||||
teams_2 = await prisma_client.get_data(
|
||||
table_name="team",
|
||||
query_type="find_all",
|
||||
team_id_list=None,
|
||||
)
|
||||
else:
|
||||
teams_2 = await prisma_client.get_data(
|
||||
team_id_list=caller_user_info.teams,
|
||||
table_name="team",
|
||||
query_type="find_all",
|
||||
)
|
||||
|
||||
if teams_2 is not None and isinstance(teams_2, list):
|
||||
for team in teams_2:
|
||||
|
|
|
|||
|
|
@ -1190,6 +1190,8 @@ class PrismaClient:
|
|||
response = await self.db.litellm_teamtable.find_many(
|
||||
where={"team_id": {"in": team_id_list}}
|
||||
)
|
||||
elif query_type == "find_all" and team_id_list is None:
|
||||
response = await self.db.litellm_teamtable.find_many(take=20)
|
||||
return response
|
||||
elif table_name == "user_notification":
|
||||
if query_type == "find_unique":
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue