mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-22 00:31:44 +00:00
fix(proxy): seed member budget forks from the row the membership points at
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
9d5f65c26c
commit
7d65d9d774
1 changed files with 2 additions and 6 deletions
|
|
@ -591,16 +591,12 @@ async def _upsert_budget_and_membership(
|
|||
"updated_by": user_api_key_dict.user_id or "",
|
||||
}
|
||||
|
||||
if team_default_budget_id is not None:
|
||||
default_budget_row: Final = await tx.litellm_budgettable.find_unique(
|
||||
where={"budget_id": team_default_budget_id}
|
||||
)
|
||||
if is_shared_default:
|
||||
default_budget_row: Final = await tx.litellm_budgettable.find_unique(where={"budget_id": existing_budget_id})
|
||||
if default_budget_row is not None:
|
||||
default_budget_dict: Final = default_budget_row.model_dump()
|
||||
for field in _TEAM_MEMBER_BUDGET_LIMIT_FIELDS:
|
||||
value = default_budget_dict.get(field)
|
||||
if field == "max_budget" and value == 0 and not is_shared_default:
|
||||
continue
|
||||
if _is_set_budget_value(value):
|
||||
create_data[field] = value
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue