mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-17 04:34:25 +00:00
Assign user_id if not present in key/generate
If the user_id is not specified in the key/generate request it is not added automatically and doesn't appear in the dashboard.
This commit is contained in:
parent
fd1a986596
commit
8911a14eaa
1 changed files with 3 additions and 0 deletions
|
|
@ -580,6 +580,9 @@ async def _common_key_generation_helper( # noqa: PLR0915
|
|||
prisma_client=prisma_client,
|
||||
)
|
||||
|
||||
if data_json.get("user_id", None) is None:
|
||||
data_json["user_id"] = user_api_key_dict.user_id
|
||||
|
||||
await _enforce_unique_key_alias(
|
||||
key_alias=data_json.get("key_alias", None),
|
||||
prisma_client=prisma_client,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue