bugfix
This commit is contained in:
parent
7e45b4d0e2
commit
fd960cffee
7
accounting/getdbname.py
Normal file
7
accounting/getdbname.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
from ahserver.serverenv import get_serverenv
|
||||||
|
|
||||||
|
def get_dbname():
|
||||||
|
f = get_serverenv('get_module_dbname')
|
||||||
|
if f is None:
|
||||||
|
raise Exception('get_module_dbname() not found')
|
||||||
|
return f('accounting')
|
@ -4,6 +4,7 @@ from appPublic.uniqueID import getID
|
|||||||
from sqlor.dbpools import DBPools
|
from sqlor.dbpools import DBPools
|
||||||
from appPublic.timeUtils import curDateString
|
from appPublic.timeUtils import curDateString
|
||||||
from appPublic.argsConvert import ArgsConvert
|
from appPublic.argsConvert import ArgsConvert
|
||||||
|
from getdbname import get_dbname
|
||||||
from .accounting_config import get_accounting_config, Accounting
|
from .accounting_config import get_accounting_config, Accounting
|
||||||
from .const import *
|
from .const import *
|
||||||
from .excep import *
|
from .excep import *
|
||||||
@ -79,7 +80,7 @@ async def recharge_accounting(sor, customerid, action, orderid, transdate, recha
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
db = DBPools()
|
db = DBPools()
|
||||||
dbname = await rfrun('get_module_dbname', 'accounting')
|
dbname = get_dbname()
|
||||||
async with db.sqlorContext(dbname) as sor:
|
async with db.sqlorContext(dbname) as sor:
|
||||||
r = await ra.accounting(sor)
|
r = await ra.accounting(sor)
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user