mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix(utils.py): only return non-null default values
This commit is contained in:
parent
fd72aa3ac5
commit
83180c50f7
2 changed files with 7 additions and 3 deletions
|
@ -30,7 +30,7 @@ from litellm.proxy.utils import PrismaClient
|
||||||
|
|
||||||
def get_new_internal_user_defaults(
|
def get_new_internal_user_defaults(
|
||||||
user_id: str, user_email: Optional[str] = None
|
user_id: str, user_email: Optional[str] = None
|
||||||
) -> SSOUserDefinedValues:
|
) -> dict:
|
||||||
user_info = litellm.default_user_params or {}
|
user_info = litellm.default_user_params or {}
|
||||||
|
|
||||||
returned_dict: SSOUserDefinedValues = {
|
returned_dict: SSOUserDefinedValues = {
|
||||||
|
@ -44,7 +44,11 @@ def get_new_internal_user_defaults(
|
||||||
"user_role": "internal_user",
|
"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(
|
async def add_new_member(
|
||||||
|
|
|
@ -1236,7 +1236,7 @@ def test_generate_and_update_key(prisma_client):
|
||||||
asyncio.run(test())
|
asyncio.run(test())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Got Exception", 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):
|
def test_key_generate_with_custom_auth(prisma_client):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue