mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
refactor(team): derive bulk update response fields from budget patch map
Drop the duplicate frozenset allowlist and reuse _MEMBER_BUDGET_PATCH_FIELDS so successful_updates stays in sync with the budget fields the write path applies
This commit is contained in:
parent
a3768b489f
commit
1788560aef
1 changed files with 1 additions and 12 deletions
|
|
@ -3074,17 +3074,6 @@ async def _apply_team_member_update(
|
|||
)
|
||||
|
||||
|
||||
_BULK_MEMBER_RESPONSE_FIELDS = frozenset(
|
||||
{
|
||||
"max_budget_in_team",
|
||||
"tpm_limit",
|
||||
"rpm_limit",
|
||||
"budget_duration",
|
||||
"allowed_models",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def _successful_member_update_response(
|
||||
*,
|
||||
team_id: str,
|
||||
|
|
@ -3095,7 +3084,7 @@ def _successful_member_update_response(
|
|||
return TeamMemberUpdateResponse(
|
||||
team_id=team_id,
|
||||
user_id=user_id,
|
||||
**{field: getattr(update_fields, field) for field in _BULK_MEMBER_RESPONSE_FIELDS if field in fields_set},
|
||||
**{field: getattr(update_fields, field) for field in _MEMBER_BUDGET_PATCH_FIELDS if field in fields_set},
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue