From 43a06ab573dd3b4bfc6bb64e40f351c660455cfe Mon Sep 17 00:00:00 2001 From: Smeet Agrawal Date: Thu, 9 Apr 2026 11:22:34 +0530 Subject: [PATCH] style: apply Black formatting Co-Authored-By: Claude Sonnet 4.6 --- .../internal_user_endpoints.py | 26 +++++++++---------- .../test_internal_user_endpoints.py | 16 +++++++----- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.py index b659b064ff5..39577e194f2 100644 --- a/litellm/proxy/management_endpoints/internal_user_endpoints.py +++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py @@ -81,9 +81,9 @@ def _update_internal_new_user_params(data_json: dict, data: NewUserRequest) -> d auto_create_key = data_json.pop("auto_create_key", True) if auto_create_key is False: - data_json[ - "table_name" - ] = "user" # only create a user, don't create key if 'auto_create_key' set to False + data_json["table_name"] = ( + "user" # only create a user, don't create key if 'auto_create_key' set to False + ) if litellm.default_internal_user_params and ( data.user_role != LitellmUserRoles.PROXY_ADMIN.value @@ -1121,9 +1121,9 @@ def _update_internal_user_params( "budget_duration" not in non_default_values ): # applies internal user limits, if user role updated if is_internal_user and litellm.internal_user_budget_duration is not None: - non_default_values[ - "budget_duration" - ] = litellm.internal_user_budget_duration + non_default_values["budget_duration"] = ( + litellm.internal_user_budget_duration + ) from litellm.proxy.common_utils.timezone_utils import get_budget_reset_time non_default_values["budget_reset_at"] = get_budget_reset_time( @@ -2384,13 +2384,13 @@ async def ui_view_users( } # Query users with pagination and filters - users: Optional[ - List[BaseModel] - ] = await prisma_client.db.litellm_usertable.find_many( - where=where_conditions, - skip=skip, - take=page_size, - order={"created_at": "desc"}, + users: Optional[List[BaseModel]] = ( + await prisma_client.db.litellm_usertable.find_many( + where=where_conditions, + skip=skip, + take=page_size, + order={"created_at": "desc"}, + ) ) if not users: diff --git a/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py index 5f31e7f5064..8f59c20dcf6 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py +++ b/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py @@ -2591,9 +2591,9 @@ async def test_new_user_password_is_hashed_and_stored(mocker): # Password must NOT be passed to generate_key_helper_fn call_kwargs = mock_generate_key.call_args.kwargs - assert "password" not in call_kwargs, ( - "password should be popped before calling generate_key_helper_fn" - ) + assert ( + "password" not in call_kwargs + ), "password should be popped before calling generate_key_helper_fn" # Password must be stored via a separate update call with the correct args mock_update.assert_called_once() @@ -2602,12 +2602,14 @@ async def test_new_user_password_is_hashed_and_stored(mocker): stored_password = call_kwargs.kwargs["data"]["password"] # Must NOT be stored as plaintext - assert stored_password != plaintext_password, "Password must not be stored as plaintext" + assert ( + stored_password != plaintext_password + ), "Password must not be stored as plaintext" # Must be verifiable - assert verify_password(plaintext_password, stored_password), ( - "Stored password hash must verify against the original plaintext" - ) + assert verify_password( + plaintext_password, stored_password + ), "Stored password hash must verify against the original plaintext" @pytest.mark.asyncio