refactor(proxy): rename the audit hook's user row variable

The typed-vs-raw distinction the _litellm_typed suffix marked is gone now that
the repository returns LiteLLM_UserTable directly.
This commit is contained in:
mateo-berri 2026-08-01 01:39:35 +00:00
parent cee78d61ea
commit 7c388b1fd9
No known key found for this signature in database

View file

@ -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: