The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
refactor(proxy): rename the audit hook's user row variable
mateo-berri7c388b1fd97a
diff --git a/litellm/proxy/hooks/user_management_event_hooks.py b/litellm/proxy/hooks/user_management_event_hooks.pyindex d8cfae5dab0..e40db7f3f1f 100644--- a/litellm/proxy/hooks/user_management_event_hooks.py+++ b/litellm/proxy/hooks/user_management_event_hooks.py@@ -57,18 +57,18 @@ class UserManagementEventHooks:raise Exception(CommonProxyErrors.db_not_connected_error.value)if response.user_id is None:raise Exception("no user_id returned for the newly created user")- user_row_litellm_typed = await UserRepository(prisma_client).find_by_id(response.user_id)- if user_row_litellm_typed is None:+ user_row = await UserRepository(prisma_client).find_by_id(response.user_id)+ if user_row is None:raise Exception(f"no user row found for user_id={response.user_id}")asyncio.create_task(UserManagementEventHooks.create_internal_user_audit_log(- user_id=user_row_litellm_typed.user_id,+ user_id=user_row.user_id,action="created",litellm_changed_by=user_api_key_dict.user_id,user_api_key_dict=user_api_key_dict,litellm_proxy_admin_name=litellm_proxy_admin_name,before_value=None,- after_value=user_row_litellm_typed.model_dump_json(exclude_none=True),+ after_value=user_row.model_dump_json(exclude_none=True),))except Exception as e: