From fd4086d5daee389276d67f97d0e2d9ddbdda776b Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 12 Mar 2024 11:05:41 -0700 Subject: [PATCH] fix(proxy_server.py): fix /user/info for non-existent user id --- litellm/proxy/proxy_server.py | 4 +++- litellm/proxy/utils.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 45f432f9d..0bb127167 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -4689,7 +4689,9 @@ async def user_info( if team.team_id not in team_id_list: team_list.append(team) team_id_list.append(team.team_id) - elif user_api_key_dict.user_id is not None: + elif ( + user_api_key_dict.user_id is not None and user_id is None + ): # the key querying the endpoint is the one asking for it's teams caller_user_info = await prisma_client.get_data( user_id=user_api_key_dict.user_id ) diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 4bfb87058..42ae6a378 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -767,7 +767,7 @@ class PrismaClient: ): args_passed_in = locals() verbose_proxy_logger.debug( - f"PrismaClient: get_data: token={token}, table_name: {table_name}, query_type: {query_type}, user_id: {user_id}, user_id_list: {user_id_list}, team_id: {team_id}, team_id_list: {team_id_list}, key_val: {key_val}" + f"PrismaClient: get_data - args_passed_in: {args_passed_in}" ) try: response: Any = None