added remove pending action function, now called in consent module when pending action is completed
This commit is contained in:
@@ -29,11 +29,17 @@ function modpol.modules.consent:new_process(id, request_id, org_id)
|
||||
setmetatable(process, modpol.modules.consent)
|
||||
modpol.ocutil.log('Created new process #' .. id .. ' for request id #' .. request_id)
|
||||
|
||||
-- modpol.orgs.get_org(self.org_id):add_pending_action('luke', self.id, 'approve')
|
||||
local p_org = modpol.orgs.get_org(org_id)
|
||||
|
||||
for i, member in ipairs(p_org.members) do
|
||||
p_org:add_pending_action(id, member, 'approve')
|
||||
end
|
||||
|
||||
return process
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- =========================================
|
||||
-- function to delete a process, called when process finishes
|
||||
function modpol.modules.consent:delete()
|
||||
@@ -59,6 +65,9 @@ function modpol.modules.consent:approve(user, decision)
|
||||
end
|
||||
|
||||
self.total_votes = self.total_votes + 1
|
||||
|
||||
local p_org = modpol.orgs.get_org(self.org_id)
|
||||
p_org:remove_pending_action(self.id, user, "approve")
|
||||
|
||||
self:update_status()
|
||||
end
|
||||
|
Reference in New Issue
Block a user