diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.py index 091465968..280ff2ad2 100644 --- a/litellm/proxy/management_endpoints/internal_user_endpoints.py +++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py @@ -778,6 +778,11 @@ async def delete_user( where={"user_id": {"in": data.user_ids}} ) + ## DELETE ASSOCIATED INVITATION LINKS + await prisma_client.db.litellm_invitationlink.delete_many( + where={"user_id": {"in": data.user_ids}} + ) + ## DELETE USERS deleted_users = await prisma_client.db.litellm_usertable.delete_many( where={"user_id": {"in": data.user_ids}} diff --git a/litellm/proxy/management_endpoints/team_endpoints.py b/litellm/proxy/management_endpoints/team_endpoints.py index b85ddb6ca..0d2fb9925 100644 --- a/litellm/proxy/management_endpoints/team_endpoints.py +++ b/litellm/proxy/management_endpoints/team_endpoints.py @@ -748,7 +748,9 @@ async def team_info( detail={"message": "Malformed request. No team id passed in."}, ) - if user_api_key_dict.team_id or (team_id != user_api_key_dict.team_id): + if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN.value: + pass + elif user_api_key_dict.team_id or (team_id != user_api_key_dict.team_id): raise HTTPException( status_code=status.HTTP_403_FORBIDDEN, detail="key not allowed to access this team's info",