mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
fix(internal_user_endpoints.py): fix check to pass testing
This commit is contained in:
parent
124fa538ed
commit
e10da75541
1 changed files with 4 additions and 2 deletions
|
@ -973,17 +973,19 @@ async def get_users(
|
|||
"in": user_id_list,
|
||||
}
|
||||
|
||||
if user_email:
|
||||
if user_email is not None and isinstance(user_email, str):
|
||||
where_conditions["user_email"] = {
|
||||
"contains": user_email,
|
||||
"mode": "insensitive", # Case-insensitive search
|
||||
}
|
||||
|
||||
if team:
|
||||
if team is not None and isinstance(team, str):
|
||||
where_conditions["teams"] = {
|
||||
"has": team # Array contains for string arrays in Prisma
|
||||
}
|
||||
|
||||
## Filter any none fastapi.Query params - e.g. where_conditions: {'user_email': {'contains': Query(None), 'mode': 'insensitive'}, 'teams': {'has': Query(None)}}
|
||||
where_conditions = {k: v for k, v in where_conditions.items() if v is not None}
|
||||
users = await prisma_client.db.litellm_usertable.find_many(
|
||||
where=where_conditions,
|
||||
skip=skip,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue