bugfix
This commit is contained in:
parent
01c3fe1139
commit
a186291253
@ -10,9 +10,18 @@ for k,v in ns.items():
|
|||||||
db = DBPools()
|
db = DBPools()
|
||||||
dbname = get_module_dbname('pricing')
|
dbname = get_module_dbname('pricing')
|
||||||
async with db.sqlorContext(dbname) as sor:
|
async with db.sqlorContext(dbname) as sor:
|
||||||
|
ori = await sor.R('pricing_item', {'id': ns.id})
|
||||||
r = await sor.U('pricing_item', ns)
|
ori_sv = {}
|
||||||
debug('update success');
|
if ori.spec_value:
|
||||||
|
ori_sv = json.loads(ori.spec_value)
|
||||||
|
fs = await sor_get_spec_fields(sor, ns.id)
|
||||||
|
if len(fs):
|
||||||
|
new_sv = {k:ns[k] for k in fs}
|
||||||
|
if new_sv:
|
||||||
|
ori_sv.update(new_sv)
|
||||||
|
ns.spec_value = json.dumps(ori_sv, indent=4)
|
||||||
|
r = await sor.U('pricing_item', ns.copy())
|
||||||
|
debug('update success, {ns=}');
|
||||||
return {
|
return {
|
||||||
"widgettype":"Message",
|
"widgettype":"Message",
|
||||||
"options":{
|
"options":{
|
||||||
@ -33,4 +42,4 @@ return {
|
|||||||
"timeout":3,
|
"timeout":3,
|
||||||
"message":"failed"
|
"message":"failed"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user