From 9e9b937cb2ff838aa880c6e3fa84aa184582fc85 Mon Sep 17 00:00:00 2001 From: jesus Date: Thu, 17 Sep 2026 23:53:47 +0000 Subject: [PATCH] chore(keys): suppress LIT002 on project assignment error payloads Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../proxy/management_endpoints/key_management_endpoints.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/management_endpoints/key_management_endpoints.py b/litellm/proxy/management_endpoints/key_management_endpoints.py index 8649c3a690e..5ab5ebe0371 100644 --- a/litellm/proxy/management_endpoints/key_management_endpoints.py +++ b/litellm/proxy/management_endpoints/key_management_endpoints.py @@ -1788,20 +1788,20 @@ async def _validate_project_assignment( if project_obj is None: raise HTTPException( status_code=404, - detail={"error": f"Project not found, project_id={data.project_id}"}, + detail={"error": f"Project not found, project_id={data.project_id}"}, # mutable-ok: HTTPException.detail has no immutable form ) team: Final = data.team_id if "team_id" in data.model_fields_set else existing_key_row.team_id if team is None or team != project_obj.team_id: raise HTTPException( status_code=400, - detail={ + detail={ # mutable-ok: HTTPException.detail has no immutable form "error": f"Project {data.project_id} belongs to team {project_obj.team_id}. Keys can only be assigned to a project owned by their own team (key team: {team})" }, ) await _check_project_key_limits( project_id=data.project_id, data=data.model_copy( - update={ + update={ # mutable-ok: model_copy takes a dict-shaped update payload "models": data.models if "models" in data.model_fields_set else existing_key_row.models, "max_budget": data.max_budget if data.max_budget is not None else existing_key_row.max_budget, }