mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
Fix early-return guard ignoring clear_budget_duration flag
When clear_budget_duration=True with all budget limits None, the guard at the top of _upsert_budget_and_membership was short-circuiting to disconnect the budget, bypassing the intended update. Adding `not clear_budget_duration` to the guard condition lets the function reach the update path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9596d27e45
commit
be7fd219be
1 changed files with 1 additions and 1 deletions
|
|
@ -376,7 +376,7 @@ async def _upsert_budget_and_membership(
|
|||
If max_budget, tpm_limit, rpm_limit, and budget_duration are all None, the user's budget is removed from the team membership.
|
||||
If any of these values exist, a budget is updated or created and linked to the team membership.
|
||||
"""
|
||||
if max_budget is None and tpm_limit is None and rpm_limit is None and budget_duration is None:
|
||||
if max_budget is None and tpm_limit is None and rpm_limit is None and budget_duration is None and not clear_budget_duration:
|
||||
# disconnect the budget since all limits are None
|
||||
await tx.litellm_teammembership.update(
|
||||
where={"user_id_team_id": {"user_id": user_id, "team_id": team_id}},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue