This commit is contained in:
yumoqing 2026-04-01 18:19:16 +08:00
parent 3098c3dd7e
commit 593f60a7a0

View File

@ -2,12 +2,17 @@ debug(f'{params_kw=}')
db = DBPools() db = DBPools()
dbname = get_module_dbname('rbac') dbname = get_module_dbname('rbac')
async with db.sqlorContext(dbname) as sor: async with db.sqlorContext(dbname) as sor:
orgid = await register_user(sor, params_kw) data = await register_user(sor, params_kw)
data = DictObject(**data)
try: try:
if data['status'] == 'error':
debug(f"{data.data.message}"
return UiError(title='Error', message=data.data.message)
orgid = data.data.user.orgid
await openCustomerAccounts(sor, '0', orgid) await openCustomerAccounts(sor, '0', orgid)
debug(f'{orgid} accounts opened') debug(f'{orgid} accounts opened')
except Exception as e: except Exception as e:
exception(f'{e}') exception(f'{e},{orgid=}')
return UiMessage(title="Success", message=f"register success {orgid}") return UiMessage(title="Success", message=f"register success {orgid}")
return UiError(title='Error', message="register failed") return UiError(title='Error', message="register failed")