fix(proxy_server.py): fix sql query

This commit is contained in:
Krrish Dholakia 2024-03-06 19:41:12 -08:00
parent ca97ea8acd
commit d1d8adfb11
2 changed files with 5 additions and 2 deletions

View file

@ -831,7 +831,10 @@ async def user_api_key_auth(
raise Exception(
f"This key is made for LiteLLM UI, Tried to access route: {route}. Not allowed"
)
return UserAPIKeyAuth(api_key=api_key, **valid_token_dict)
if valid_token_dict is not None:
return UserAPIKeyAuth(api_key=api_key, **valid_token_dict)
else:
raise Exception()
except Exception as e:
# verbose_proxy_logger.debug(f"An exception occurred - {traceback.format_exc()}")
traceback.print_exc()

View file

@ -973,7 +973,7 @@ class PrismaClient:
t.rpm_limit AS team_rpm_limit,
m.aliases as team_model_aliases
FROM "LiteLLM_VerificationToken" AS v
INNER JOIN "LiteLLM_TeamTable" AS t ON v.team_id = t.team_id
LEFT JOIN "LiteLLM_TeamTable" AS t ON v.team_id = t.team_id
LEFT JOIN "LiteLLM_ModelTable" m ON t.model_id = m.id
WHERE v.token = '{token}'
"""