fix: auto-set orgid in tenant_domain create
This commit is contained in:
parent
475845261e
commit
91861c828b
@ -5,6 +5,9 @@ for k,v in ns.items():
|
|||||||
if not ns.get("id"):
|
if not ns.get("id"):
|
||||||
ns["id"] = getID()
|
ns["id"] = getID()
|
||||||
env = request._run_ns
|
env = request._run_ns
|
||||||
|
userorgid = await env.get_userorgid()
|
||||||
|
if not ns.get("orgid"):
|
||||||
|
ns["orgid"] = userorgid or "0"
|
||||||
async with get_sor_context(env, "tenant") as sor:
|
async with get_sor_context(env, "tenant") as sor:
|
||||||
await sor.C("tenant_domain", ns)
|
await sor.C("tenant_domain", ns)
|
||||||
return {"status": "ok"}
|
return {"status": "ok"}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user