mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
test(proxy_server.py): check if token has team params
This commit is contained in:
parent
56ee5b4762
commit
e7ff2fd4a5
1 changed files with 4 additions and 1 deletions
|
@ -614,6 +614,7 @@ async def user_api_key_auth(
|
||||||
# Check 6. Token spend is under Team budget
|
# Check 6. Token spend is under Team budget
|
||||||
if (
|
if (
|
||||||
valid_token.spend is not None
|
valid_token.spend is not None
|
||||||
|
and hasattr(valid_token, "team_max_budget")
|
||||||
and valid_token.team_max_budget is not None
|
and valid_token.team_max_budget is not None
|
||||||
):
|
):
|
||||||
asyncio.create_task(
|
asyncio.create_task(
|
||||||
|
@ -632,7 +633,9 @@ async def user_api_key_auth(
|
||||||
|
|
||||||
# Check 7. Team spend is under Team budget
|
# Check 7. Team spend is under Team budget
|
||||||
if (
|
if (
|
||||||
valid_token.team_spend is not None
|
hasattr(valid_token, "team_spend")
|
||||||
|
and valid_token.team_spend is not None
|
||||||
|
and hasattr(valid_token, "team_max_budget")
|
||||||
and valid_token.team_max_budget is not None
|
and valid_token.team_max_budget is not None
|
||||||
):
|
):
|
||||||
asyncio.create_task(
|
asyncio.create_task(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue