fix(proxy_server.py): fix linting errors

This commit is contained in:
Krrish Dholakia 2023-11-23 21:42:31 -08:00
parent 19fb24cd15
commit c9e37b8fb8

View file

@ -355,10 +355,13 @@ async def generate_key_helper_fn(duration_str: str, models: list, aliases: dict,
async def delete_verification_token(tokens: List[str]): async def delete_verification_token(tokens: List[str]):
global prisma_client global prisma_client
try: try:
if prisma_client:
# Assuming 'db' is your Prisma Client instance # Assuming 'db' is your Prisma Client instance
deleted_tokens = await prisma_client.litellm_verificationtoken.delete_many( deleted_tokens = await prisma_client.litellm_verificationtoken.delete_many(
where={"token": {"in": tokens}} where={"token": {"in": tokens}}
) )
else:
raise Exception
except Exception as e: except Exception as e:
traceback.print_exc() traceback.print_exc()
raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR) raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR)
@ -666,7 +669,7 @@ async def generate_key_fn(request: Request):
) )
@router.post("/key/delete", dependencies=[Depends(user_api_key_auth)]) @router.post("/key/delete", dependencies=[Depends(user_api_key_auth)])
async def generate_key_fn(request: Request): async def delete_key_fn(request: Request):
try: try:
data = await request.json() data = await request.json()