From e2d75a100a30387f6010e57a38851ab44dccb838 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 24 Aug 2024 17:41:37 -0700 Subject: [PATCH] fix: fix linting errors --- litellm/proxy/management_helpers/utils.py | 4 ++-- litellm/tests/test_exceptions.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litellm/proxy/management_helpers/utils.py b/litellm/proxy/management_helpers/utils.py index efbe667fb68..af8e8520134 100644 --- a/litellm/proxy/management_helpers/utils.py +++ b/litellm/proxy/management_helpers/utils.py @@ -109,8 +109,8 @@ async def add_new_member( where={"user_id": user_info.user_id}, # type: ignore data={"teams": {"push": [team_id]}}, ) - - returned_user = LiteLLM_UserTable(**_returned_user.model_dump()) + if _returned_user is not None: + returned_user = LiteLLM_UserTable(**_returned_user.model_dump()) elif len(existing_user_row) > 1: raise HTTPException( status_code=400, diff --git a/litellm/tests/test_exceptions.py b/litellm/tests/test_exceptions.py index 0388e026b9f..a570692f6db 100644 --- a/litellm/tests/test_exceptions.py +++ b/litellm/tests/test_exceptions.py @@ -864,7 +864,7 @@ def _pre_call_utils( data["messages"] = [{"role": "user", "content": "Hello world"}] if streaming is True: data["stream"] = True - mapped_target = client.chat.completions.with_raw_response + mapped_target = client.chat.completions.with_raw_response # type: ignore if sync_mode: original_function = litellm.completion else: @@ -873,7 +873,7 @@ def _pre_call_utils( data["prompt"] = "Hello world" if streaming is True: data["stream"] = True - mapped_target = client.completions.with_raw_response + mapped_target = client.completions.with_raw_response # type: ignore if sync_mode: original_function = litellm.text_completion else: