From 5208a12eff80beebab2f84dbd8f4967cdcd4de9b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 26 Nov 2024 22:45:38 +0800 Subject: [PATCH] bugfix --- wwwroot/add_adminuser.dspy | 12 ++++++++---- wwwroot/add_adminuser.ui | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/wwwroot/add_adminuser.dspy b/wwwroot/add_adminuser.dspy index f1aa402..61af0de 100644 --- a/wwwroot/add_adminuser.dspy +++ b/wwwroot/add_adminuser.dspy @@ -4,10 +4,12 @@ if params_kw.get('password') != params_kw.get('chkpassword'): ns = params_kw.copy() ns['id'] = uuid() await rfexe('passowrd', ns) -user_orgid = await get_user_orgid() +user_orgid = await get_userorgid() ns['orgid'] = user_orgid -dbname = rfexe('get_module_dbname','rbac') -async db.sqlorConext(dbname) as sor: +dbname = await rfexe('get_module_dbname','rbac') +db = DBPools() +debug(f'{dbname=}') +async with db.sqlorContext(dbname) as sor: await sor.C('users',ns.copy()) uid = ns['id'] ns = { @@ -16,4 +18,6 @@ async db.sqlorConext(dbname) as sor: 'roleid':'admin' } await sor.C('userrole', ns.copy()) - + return UiMesage(title='Success', message='admin user added') +return UiError(title='Error', message='Error happened when add admin user') + diff --git a/wwwroot/add_adminuser.ui b/wwwroot/add_adminuser.ui index e254880..f48332e 100644 --- a/wwwroot/add_adminuser.ui +++ b/wwwroot/add_adminuser.ui @@ -3,7 +3,7 @@ "options":{ "archor":"cc", "cwidth":16, - "chegith":10 + "chegith":10, "title":"add admin user" }, "subwidgets":[