forked from phoenix/litellm-mirror
fix(proxy_server.py): fix linting errors
This commit is contained in:
parent
19fb24cd15
commit
c9e37b8fb8
1 changed files with 8 additions and 5 deletions
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue