From 95eba74491b6fcaa65e262af41a3fc358a84a835 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 6 Jan 2026 17:40:07 +0800 Subject: [PATCH] bugfix --- llmage/accounting.py | 9 +++++---- wwwroot/llm_dialog.ui | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/llmage/accounting.py b/llmage/accounting.py index 6b9ad01..517cf72 100644 --- a/llmage/accounting.py +++ b/llmage/accounting.py @@ -15,15 +15,16 @@ async def checkCustomerBalance(llmid, userorgid): e = Exception(f'llm({llmid}) not exists') exception(f'{e}') raise e - llm = llms[0] + llm = llms[0].copy() if llm.ownerid == userorgid: return True balance = await getCustomerBalance(sor, userorgid) - if balance is None: - balance = 0.00 + bal = 0 if balance is None else balance if llm.min_balance is None: llm.min_balance = 0.00 - return llm.ppid and llm.min_balance < balance + ret = llm.ppid and llm.min_balance < bal + debug(f'{llms=},{userorgid=},{balance=},{ret=}') + return ret return False async def llm_accounting(request, llmid, diff --git a/wwwroot/llm_dialog.ui b/wwwroot/llm_dialog.ui index da315e2..639a848 100644 --- a/wwwroot/llm_dialog.ui +++ b/wwwroot/llm_dialog.ui @@ -1,5 +1,5 @@ {% if get_user() %} -{% set userorgid = get_userorgid %} +{% set userorgid = get_userorgid() %} {% if checkCustomerBalance(params_kw.id, userorgid) %} {% set llm = get_llm(params_kw.id) %} {% set kdbs = get_user_kdbs(request) %}