mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix(proxy_server.py): fix handling none value for existing spend object pt.2
This commit is contained in:
parent
12b2ad9ed1
commit
34c4532e7e
2 changed files with 4 additions and 2 deletions
|
@ -329,7 +329,7 @@ class LiteLLM_UserTable(LiteLLMBase):
|
||||||
if values.get("spend") is None:
|
if values.get("spend") is None:
|
||||||
values.update({"spend": 0.0})
|
values.update({"spend": 0.0})
|
||||||
if values.get("models") is None:
|
if values.get("models") is None:
|
||||||
values.update({"models", []})
|
values.update({"models": []})
|
||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -692,7 +692,9 @@ async def update_database(
|
||||||
)
|
)
|
||||||
if existing_spend_obj is None:
|
if existing_spend_obj is None:
|
||||||
existing_spend = 0
|
existing_spend = 0
|
||||||
existing_spend = LiteLLM_UserTable(user_id=id, spend=0)
|
existing_spend_obj = LiteLLM_UserTable(
|
||||||
|
user_id=id, spend=0, max_budget=None, user_email=None
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
existing_spend = existing_spend_obj.spend
|
existing_spend = existing_spend_obj.spend
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue