diff --git a/llmage/accounting.py b/llmage/accounting.py index a30ba9c..6b9ad01 100644 --- a/llmage/accounting.py +++ b/llmage/accounting.py @@ -15,11 +15,15 @@ async def checkCustomerBalance(llmid, userorgid): e = Exception(f'llm({llmid}) not exists') exception(f'{e}') raise e - if llms[0].ownerid == userorgid: + llm = llms[0] + if llm.ownerid == userorgid: return True balance = await getCustomerBalance(sor, userorgid) - if balance is None: balance = 0.00 - return llms[0].ppid and llms[0].min_balance < balance + if balance is None: + balance = 0.00 + if llm.min_balance is None: + llm.min_balance = 0.00 + return llm.ppid and llm.min_balance < balance return False async def llm_accounting(request, llmid,