mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-18 18:18:28 +00:00
fix: use direct attribute access with or [] fallback in _resolve_access_group_resources
Replace getattr(ag, "field", []) with ag.field or [] for cleaner access and safe handling if a field is None.
This commit is contained in:
@@ -3392,9 +3392,9 @@ async def _resolve_access_group_resources(
|
||||
user_api_key_cache=_user_api_key_cache,
|
||||
proxy_logging_obj=_proxy_logging_obj,
|
||||
)
|
||||
models.extend(getattr(ag, "access_model_names", []))
|
||||
mcp_ids.extend(getattr(ag, "access_mcp_server_ids", []))
|
||||
agent_ids.extend(getattr(ag, "access_agent_ids", []))
|
||||
models.extend(ag.access_model_names or [])
|
||||
mcp_ids.extend(ag.access_mcp_server_ids or [])
|
||||
agent_ids.extend(ag.access_agent_ids or [])
|
||||
except Exception:
|
||||
verbose_proxy_logger.debug(
|
||||
"Could not fetch access group %s for resource resolution",
|
||||
|
||||
Reference in New Issue
Block a user