mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
test(test_proxy_server.py): unit testing to make sure internal user params don't impact admin
This commit is contained in:
parent
4b40563be3
commit
6af9d9d2b3
2 changed files with 28 additions and 8 deletions
|
@ -87,12 +87,16 @@ async def new_user(
|
|||
"user" # only create a user, don't create key if 'auto_create_key' set to False
|
||||
)
|
||||
|
||||
is_internal_user = False
|
||||
if data.user_role == LitellmUserRoles.INTERNAL_USER:
|
||||
is_internal_user = True
|
||||
|
||||
if "max_budget" in data_json and data_json["max_budget"] is None:
|
||||
if litellm.max_internal_user_budget is not None:
|
||||
if is_internal_user and litellm.max_internal_user_budget is not None:
|
||||
data_json["max_budget"] = litellm.max_internal_user_budget
|
||||
|
||||
if "budget_duration" in data_json and data_json["budget_duration"] is None:
|
||||
if litellm.internal_user_budget_duration is not None:
|
||||
if is_internal_user and litellm.internal_user_budget_duration is not None:
|
||||
data_json["budget_duration"] = litellm.internal_user_budget_duration
|
||||
|
||||
response = await generate_key_helper_fn(request_type="user", **data_json)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue