Created remove_process module---mostly works, but there are still some issues with processes and pending actions not being removed properly
This commit is contained in:
@ -57,11 +57,14 @@ function modpol.orgs:call_module(module_slug, initiator, config, result)
|
||||
end
|
||||
|
||||
function modpol.orgs:delete_process(id)
|
||||
local msg = "Deleting "..self.processes[id].slug..
|
||||
" process id "..id.." in org "..self.name
|
||||
self:record(msg, self.processes[id].slug)
|
||||
self:wipe_pending_actions(id)
|
||||
self.processes[id] = 'deleted'
|
||||
if self.processes[id]
|
||||
and self.processes[id] ~= "deleted" then
|
||||
local msg = "Deleting "..self.processes[id].slug..
|
||||
" process id "..id.." in org "..self.name
|
||||
self:record(msg, self.processes[id].slug)
|
||||
self:wipe_pending_actions(id)
|
||||
self.processes[id] = 'deleted'
|
||||
end
|
||||
end
|
||||
|
||||
function modpol.orgs:add_pending_action(process_id, user, callback)
|
||||
@ -101,7 +104,7 @@ function modpol.orgs:interact(process_id, user)
|
||||
local process = self.processes[process_id]
|
||||
if self.pending[user] then
|
||||
local callback = self.pending[user][process_id]
|
||||
if callback then
|
||||
if callback and process ~= "deleted" then
|
||||
-- get data in case callback ends process
|
||||
local slug = self.processes[process_id].slug
|
||||
-- run callback
|
||||
|
Reference in New Issue
Block a user