fix(utils.py): only return non-null default values

This commit is contained in:
Krrish Dholakia 2024-08-09 16:34:09 -07:00
parent fd72aa3ac5
commit 83180c50f7
2 changed files with 7 additions and 3 deletions

View file

@ -30,7 +30,7 @@ from litellm.proxy.utils import PrismaClient
def get_new_internal_user_defaults(
user_id: str, user_email: Optional[str] = None
) -> SSOUserDefinedValues:
) -> dict:
user_info = litellm.default_user_params or {}
returned_dict: SSOUserDefinedValues = {
@ -44,7 +44,11 @@ def get_new_internal_user_defaults(
"user_role": "internal_user",
}
return returned_dict
non_null_dict = {}
for k, v in returned_dict.items():
if v is not None:
non_null_dict[k] = v
return non_null_dict
async def add_new_member(

View file

@ -1236,7 +1236,7 @@ def test_generate_and_update_key(prisma_client):
asyncio.run(test())
except Exception as e:
print("Got Exception", e)
pytest.fail(f"An exception occurred - {str(e)}")
pytest.fail(f"An exception occurred - {str(e)}\n{traceback.format_exc()}")
def test_key_generate_with_custom_auth(prisma_client):