mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix /user/new
This commit is contained in:
parent
21831905ba
commit
3d4cda3373
1 changed files with 0 additions and 10 deletions
|
@ -7697,16 +7697,6 @@ async def new_user(data: NewUserRequest):
|
|||
- max_budget: (float|None) Max budget for given user.
|
||||
"""
|
||||
data_json = data.json() # type: ignore
|
||||
if "user_role" in data_json:
|
||||
user_role = data_json["user_role"]
|
||||
if user_role is not None:
|
||||
if user_role not in ["proxy_admin", "app_owner", "app_user"]:
|
||||
raise ProxyException(
|
||||
message=f"Invalid user role, passed in {user_role}. Must be one of 'admin', 'app_owner', 'app_user'",
|
||||
type="invalid_user_role",
|
||||
param="user_role",
|
||||
code=status.HTTP_400_BAD_REQUEST,
|
||||
)
|
||||
if "user_id" in data_json and data_json["user_id"] is None:
|
||||
data_json["user_id"] = str(uuid.uuid4())
|
||||
auto_create_key = data_json.pop("auto_create_key", True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue