From 47cad5474acd1f711e7c6c1dc06446efd04e84eb Mon Sep 17 00:00:00 2001 From: ymq Date: Wed, 26 Aug 2026 18:16:53 +0800 Subject: [PATCH] =?UTF-8?q?revert:=20=E5=9B=9E=E6=BB=9A=20register=5Fuser?= =?UTF-8?q?=20=E5=86=85=E5=BC=80=E6=88=B7=E2=80=94=E2=80=94=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E5=BC=80=E6=88=B7=E5=8D=95=E7=82=B9=E4=BF=9D=E7=95=99?= =?UTF-8?q?=E5=9C=A8=20register.dspy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit register.dspy 注册成功后已有 openCustomerAccounts 调用(单点开户口), 在 check_perm.register_user 里再加一处导致同一客户重复开户(实测 account 表 同 orgid 出现 2 条客户资金账户)。回滚保持单一开户点。 --- rbac/check_perm.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/rbac/check_perm.py b/rbac/check_perm.py index ed0ae03..33f0d34 100644 --- a/rbac/check_perm.py +++ b/rbac/check_perm.py @@ -144,20 +144,6 @@ async def register_user(sor, ns): } ] await create_user(sor, ns, roles) - # 自动开客户账户(accounting 模块)。旁路,不阻断注册主流程: - # 模块未加载/开户失败都只记日志,注册本身成功。 - try: - env = ServerEnv() - open_fn = getattr(env, 'openCustomerAccounts', None) - get_dbname_fn = get_serverenv('get_module_dbname') - if open_fn is not None and get_dbname_fn is not None: - acc_dbname = get_dbname_fn('accounting') - async with DBPools().sqlorContext(acc_dbname) as acc_sor: - await open_fn(acc_sor, '0', ns.orgid) - await acc_sor.sqlExe("COMMIT", {}) - debug(f'register_user: customer accounts opened for org({ns.orgid})') - except Exception as e: - debug(f'register_user: auto open customer accounts skipped: {e}') return { "status": "ok", "data": {