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:
mubashir1osmani 2026-07-16 17:11:57 -07:00
parent a3768b489f
commit 1788560aef

View file

@ -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},
)