From 1262c5cb392532bedc94bad7c616e990378ecbae Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 15 May 2024 17:27:46 -0700 Subject: [PATCH] fix - /organization/new logic --- litellm/proxy/proxy_server.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index cc5327b7589..adc25386a80 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -7809,7 +7809,12 @@ async def new_organization( If none provided, create one based on provided values """ - budget_row = LiteLLM_BudgetTable(**data.json(exclude_none=True)) + budget_params = LiteLLM_BudgetTable.model_fields.keys() + + # Only include Budget Params when creating an entry in litellm_budgettable + _json_data = data.json(exclude_none=True) + _budget_data = {k: v for k, v in _json_data.items() if k in budget_params} + budget_row = LiteLLM_BudgetTable(**_budget_data) new_budget = prisma_client.jsonify_object(budget_row.json(exclude_none=True))