mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix(internal_user_endpoints.py): add check on sortby value
This commit is contained in:
parent
31cfa8efe4
commit
b0a597c8c6
1 changed files with 6 additions and 1 deletions
|
@ -1043,7 +1043,12 @@ async def get_users(
|
||||||
where_conditions = {k: v for k, v in where_conditions.items() if v is not None}
|
where_conditions = {k: v for k, v in where_conditions.items() if v is not None}
|
||||||
|
|
||||||
# Build order_by conditions
|
# Build order_by conditions
|
||||||
order_by: Optional[Dict[str, str]] = _validate_sort_params(sort_by, sort_order)
|
|
||||||
|
order_by: Optional[Dict[str, str]] = (
|
||||||
|
_validate_sort_params(sort_by, sort_order)
|
||||||
|
if sort_by is not None and isinstance(sort_by, str)
|
||||||
|
else None
|
||||||
|
)
|
||||||
|
|
||||||
users = await prisma_client.db.litellm_usertable.find_many(
|
users = await prisma_client.db.litellm_usertable.find_many(
|
||||||
where=where_conditions,
|
where=where_conditions,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue