fix(internal_user_endpoints.py): respect 'max_user_budget' for new internal user's

This commit is contained in:
Krrish Dholakia 2024-08-07 18:50:40 -07:00
parent afd89c8105
commit e60b2d9258
2 changed files with 40 additions and 0 deletions

View file

@ -87,6 +87,10 @@ async def new_user(
"user" # only create a user, don't create key if 'auto_create_key' set to False
)
if "max_budget" in data_json and data_json["max_budget"] is None:
if litellm.max_user_budget is not None:
data_json["max_budget"] = litellm.max_user_budget
response = await generate_key_helper_fn(request_type="user", **data_json)
# Admin UI Logic