Various bugfixes on defer and processes
This commit is contained in:
parent
df20cc835b
commit
838a017f14
@ -44,6 +44,7 @@ function add_child_org:initiate(result)
|
||||
self.initiator,
|
||||
"Proposed child org: " .. input)
|
||||
-- initiate consent process
|
||||
self.data.result = result
|
||||
self:call_module(
|
||||
self.config.approval_module,
|
||||
self.initiator,
|
||||
|
@ -43,7 +43,6 @@ function defer:initiate(result)
|
||||
end
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
-- @module join_org
|
||||
|
||||
local join_org = {
|
||||
name = "Join this org (consent)",
|
||||
name = "Join this org",
|
||||
slug = "join_org",
|
||||
desc = "Adds member with consent of all members"
|
||||
desc = "Allows initiator to join this org"
|
||||
}
|
||||
|
||||
join_org.data = {
|
||||
|
@ -8,13 +8,18 @@
|
||||
-- @param config Config for module
|
||||
-- @param result
|
||||
function modpol.orgs:call_module(module_slug, initiator, config, result, parent_id)
|
||||
if not module_slug then -- if slug is false then simply run result
|
||||
|
||||
-- first, if no slug, just run result
|
||||
-- may not be necessary if we use false as default approval_module
|
||||
if not module_slug
|
||||
and result() then
|
||||
result()
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- if module doesn't exist, abort
|
||||
if not modpol.modules[module_slug] then
|
||||
modpol.ocutil.log('Error in ' .. self.name .. ':call_module -> module "' .. module_slug .. '" not found')
|
||||
modpol.ocutil.log('Error in ' .. self.name .. ':call_module -> module "' .. tostring(module_slug) .. '" not found')
|
||||
return
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user