mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix(proxy/utils.py): fix isoformat to string logic
This commit is contained in:
parent
39c699d084
commit
c2813594ea
2 changed files with 13 additions and 10 deletions
|
@ -370,19 +370,21 @@ class PrismaClient:
|
|||
response = await self.db.litellm_verificationtoken.find_unique(
|
||||
where={"token": hashed_token}
|
||||
)
|
||||
if response is not None:
|
||||
# for prisma we need to cast the expires time to str
|
||||
if isinstance(response.expires, datetime):
|
||||
response.expires = response.expires.isoformat()
|
||||
elif query_type == "find_all" and user_id is not None:
|
||||
response = await self.db.litellm_verificationtoken.find_many(
|
||||
where={"user_id": user_id}
|
||||
)
|
||||
if response is not None and len(response) > 0:
|
||||
for r in response:
|
||||
if isinstance(r.expires, datetime):
|
||||
r.expires = r.expires.isoformat()
|
||||
print_verbose(f"PrismaClient: response={response}")
|
||||
if response is not None:
|
||||
if isinstance(response, LiteLLM_VerificationToken):
|
||||
# for prisma we need to cast the expires time to str
|
||||
if isinstance(response.expires, datetime):
|
||||
response.expires = response.expires.isoformat()
|
||||
return response
|
||||
else:
|
||||
return response
|
||||
return response
|
||||
else:
|
||||
# Token does not exist.
|
||||
raise HTTPException(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue