revert: 回滚 register_user 内开户——注册开户单点保留在 register.dspy

register.dspy 注册成功后已有 openCustomerAccounts 调用(单点开户口),
在 check_perm.register_user 里再加一处导致同一客户重复开户(实测 account 表
同 orgid 出现 2 条客户资金账户)。回滚保持单一开户点。
This commit is contained in:
ymq 2026-08-26 18:16:53 +08:00
parent 1b00876cc5
commit 47cad5474a

View File

@ -144,20 +144,6 @@ async def register_user(sor, ns):
} }
] ]
await create_user(sor, ns, roles) 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 { return {
"status": "ok", "status": "ok",
"data": { "data": {