forked from phoenix/litellm-mirror
(fix) revert 469ae0a
This commit is contained in:
parent
41f5cb7f04
commit
d9fd38ae16
1 changed files with 1 additions and 14 deletions
|
@ -347,9 +347,7 @@ class PrismaClient:
|
||||||
):
|
):
|
||||||
try:
|
try:
|
||||||
print_verbose("PrismaClient: get_data")
|
print_verbose("PrismaClient: get_data")
|
||||||
# incase prisma is not connected
|
|
||||||
if self.db.is_connected() == False:
|
|
||||||
await self.connect()
|
|
||||||
response = None
|
response = None
|
||||||
if token is not None:
|
if token is not None:
|
||||||
# check if plain text or hash
|
# check if plain text or hash
|
||||||
|
@ -412,10 +410,6 @@ class PrismaClient:
|
||||||
Add a key to the database. If it already exists, do nothing.
|
Add a key to the database. If it already exists, do nothing.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
# incase prisma is not connected
|
|
||||||
if self.db.is_connected() == False:
|
|
||||||
await self.connect()
|
|
||||||
|
|
||||||
if table_name == "user+key":
|
if table_name == "user+key":
|
||||||
token = data["token"]
|
token = data["token"]
|
||||||
hashed_token = self.hash_token(token=token)
|
hashed_token = self.hash_token(token=token)
|
||||||
|
@ -494,10 +488,6 @@ class PrismaClient:
|
||||||
Update existing data
|
Update existing data
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
# incase prisma is not connected
|
|
||||||
if self.db.is_connected() == False:
|
|
||||||
await self.connect()
|
|
||||||
|
|
||||||
db_data = self.jsonify_object(data=data)
|
db_data = self.jsonify_object(data=data)
|
||||||
if token is not None:
|
if token is not None:
|
||||||
print_verbose(f"token: {token}")
|
print_verbose(f"token: {token}")
|
||||||
|
@ -540,9 +530,6 @@ class PrismaClient:
|
||||||
Allow user to delete a key(s)
|
Allow user to delete a key(s)
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
# incase prisma is not connected
|
|
||||||
if self.db.is_connected() == False:
|
|
||||||
await self.connect()
|
|
||||||
hashed_tokens = [self.hash_token(token=token) for token in tokens]
|
hashed_tokens = [self.hash_token(token=token) for token in tokens]
|
||||||
await self.db.litellm_verificationtoken.delete_many(
|
await self.db.litellm_verificationtoken.delete_many(
|
||||||
where={"token": {"in": hashed_tokens}}
|
where={"token": {"in": hashed_tokens}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue