Got first token modules working, and a bunch of bugfixes throughout
This commit is contained in:
@ -26,7 +26,7 @@ function modpol.orgs:call_module(module_slug, initiator, config, result)
|
||||
local module = modpol.modules[module_slug]
|
||||
|
||||
-- sets default values for undeclared config variables
|
||||
if #module.config > 0 then
|
||||
if modpol.util.num_pairs(module.config) > 0 and config then
|
||||
for k, v in pairs(module.config) do
|
||||
if config[k] == nil then
|
||||
config[k] = v
|
||||
@ -34,6 +34,7 @@ function modpol.orgs:call_module(module_slug, initiator, config, result)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- setting default params
|
||||
local new_process = {
|
||||
metatable = {__index = module},
|
||||
@ -101,11 +102,14 @@ function modpol.orgs:interact(process_id, user)
|
||||
if self.pending[user] then
|
||||
local callback = self.pending[user][process_id]
|
||||
if callback then
|
||||
-- get data in case callback ends process
|
||||
local slug = self.processes[process_id].slug
|
||||
-- run callback
|
||||
process[callback](process, user)
|
||||
-- record org data
|
||||
local msg = "Updating "..self.processes[process_id].slug..
|
||||
" process id "..process_id.." in org "..self.name
|
||||
self:record(msg, self.processes[process_id].slug)
|
||||
local msg = "Updating "..slug..
|
||||
" process id "..process_id.." in org "..self.name
|
||||
self:record(msg, slug)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user