mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
create_litellm_teams_from_service_principal_team_ids
This commit is contained in:
parent
958c284957
commit
f85767e4af
1 changed files with 34 additions and 27 deletions
|
@ -1193,7 +1193,12 @@ class MicrosoftSSOHandler:
|
||||||
litellm_team_name: Optional[str] = service_principal_team.get(
|
litellm_team_name: Optional[str] = service_principal_team.get(
|
||||||
"principalDisplayName"
|
"principalDisplayName"
|
||||||
)
|
)
|
||||||
if litellm_team_id:
|
if not litellm_team_id:
|
||||||
|
verbose_proxy_logger.debug(
|
||||||
|
f"Skipping team creation for {litellm_team_name} because it has no principalId"
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
verbose_proxy_logger.debug(
|
verbose_proxy_logger.debug(
|
||||||
f"Creating Litellm Team: {litellm_team_id} - {litellm_team_name}"
|
f"Creating Litellm Team: {litellm_team_id} - {litellm_team_name}"
|
||||||
|
@ -1203,6 +1208,8 @@ class MicrosoftSSOHandler:
|
||||||
where={"team_id": litellm_team_id}
|
where={"team_id": litellm_team_id}
|
||||||
)
|
)
|
||||||
verbose_proxy_logger.debug(f"Team object: {team_obj}")
|
verbose_proxy_logger.debug(f"Team object: {team_obj}")
|
||||||
|
|
||||||
|
# only create a new team if it doesn't exist
|
||||||
if team_obj:
|
if team_obj:
|
||||||
verbose_proxy_logger.debug(
|
verbose_proxy_logger.debug(
|
||||||
f"Team already exists: {litellm_team_id} - {litellm_team_name}"
|
f"Team already exists: {litellm_team_id} - {litellm_team_name}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue