mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-02 02:11:58 +00:00
fix(customer_endpoints): check role before prisma_client guard
This commit is contained in:
parent
3b8109a8ec
commit
ba4571ccd5
1 changed files with 8 additions and 8 deletions
|
|
@ -883,14 +883,6 @@ async def get_customer_daily_activity(
|
|||
"""
|
||||
Get daily activity for specific organizations or all accessible organizations.
|
||||
"""
|
||||
from litellm.proxy.proxy_server import prisma_client
|
||||
|
||||
if prisma_client is None:
|
||||
raise HTTPException(
|
||||
status_code=500,
|
||||
detail={"error": CommonProxyErrors.db_not_connected_error.value},
|
||||
)
|
||||
|
||||
if (
|
||||
user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN
|
||||
and user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN_VIEW_ONLY
|
||||
|
|
@ -904,6 +896,14 @@ async def get_customer_daily_activity(
|
|||
},
|
||||
)
|
||||
|
||||
from litellm.proxy.proxy_server import prisma_client
|
||||
|
||||
if prisma_client is None:
|
||||
raise HTTPException(
|
||||
status_code=500,
|
||||
detail={"error": CommonProxyErrors.db_not_connected_error.value},
|
||||
)
|
||||
|
||||
# Parse comma-separated ids
|
||||
end_user_ids_list = end_user_ids.split(",") if end_user_ids else None
|
||||
exclude_end_user_ids_list: Optional[List[str]] = None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue