fix migrate to LitellmUserRoles

This commit is contained in:
Ishaan Jaff 2024-05-30 13:57:50 -07:00
parent ff33241ce2
commit dc51fec22e
4 changed files with 47 additions and 21 deletions

View file

@ -15,6 +15,7 @@ from litellm.proxy._types import (
WebhookEvent,
AlertType,
ResetTeamBudgetRequest,
LitellmUserRoles,
)
from litellm.caching import DualCache, RedisCache
from litellm.router import Deployment, ModelInfo, LiteLLM_Params
@ -2637,7 +2638,7 @@ def _is_user_proxy_admin(user_id_information: Optional[list]):
_user = user_id_information[0]
if (
_user.get("user_role", None) is not None
and _user.get("user_role") == "proxy_admin"
and _user.get("user_role") == LitellmUserRoles.PROXY_ADMIN.value
):
return True
@ -2650,7 +2651,7 @@ def _is_user_proxy_admin(user_id_information: Optional[list]):
if (
_user.get("user_role", None) is not None
and _user.get("user_role") == "proxy_admin"
and _user.get("user_role") == LitellmUserRoles.PROXY_ADMIN.value
):
return True