fix: backend_accounting monkey-patch _get_db to use initialized DBPools instance
This commit is contained in:
parent
6142ce8630
commit
0f25f5d7de
@ -29,7 +29,10 @@ from product_management import get_manager
|
|||||||
# 初始化配置
|
# 初始化配置
|
||||||
p = ProgramPath()
|
p = ProgramPath()
|
||||||
config = getConfig(NS={'workdir': os.getcwd(), 'ProgramPath': p})
|
config = getConfig(NS={'workdir': os.getcwd(), 'ProgramPath': p})
|
||||||
DBPools(config.databases)
|
db = DBPools(config.databases)
|
||||||
|
# 防止 businessdate._get_db() 创建新的空 DBPools 实例
|
||||||
|
import appbase.businessdate as _bd
|
||||||
|
_bd._get_db = lambda: db
|
||||||
|
|
||||||
def get_module_dbname(m):
|
def get_module_dbname(m):
|
||||||
return 'sage'
|
return 'sage'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user