From 190fb2e4634b894bcc8ea0178083338ecbc1b81d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 6 Jan 2026 16:58:17 +0800 Subject: [PATCH] bugfix --- llmage/accounting.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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,