diff --git a/modpol/orgs/requests.lua b/modpol/orgs/requests.lua index ae941d1..4cd9012 100644 --- a/modpol/orgs/requests.lua +++ b/modpol/orgs/requests.lua @@ -53,8 +53,10 @@ end -- ======================== -- removes a pending action from the org's table function modpol.orgs:remove_pending_action(process_id, user, action) + -- cautiously checks if pending action exists before removing it if self.pending[user] then if self.pending[user][process_id] then + -- searching for action to remove for i, a in pairs(self.pending[user][process_id]) do if a == action then self.pending[user][process_id][i] = nil