Browse Source

Fixes on process logic

Nathan Schneider 1 year ago
parent
commit
9d759530e6
2 changed files with 8 additions and 10 deletions
  1. 2 2
      modpol_core/modules/change_policy.lua
  2. 6 8
      modpol_core/orgs/process.lua

+ 2 - 2
modpol_core/modules/change_policy.lua

@@ -109,8 +109,8 @@ function change_policy:approve_change(module_slug, policy, input)
       function()
          modpol.interactions.message(
             self.initiator,
-            "Updating " .. policy .. " policy on module " ..
-            module_slug .. " with: " .. input)
+            "In ".. self.org.name .. " updating " .. policy ..
+            " policy on module " .. module_slug .. " with: " .. input)
          self.org.policies[module_slug][policy] = input
          modpol.interactions.org_dashboard(
             self.initiator, self.org.id)

+ 6 - 8
modpol_core/orgs/process.lua

@@ -15,17 +15,15 @@ function modpol.orgs:call_module(module_slug, initiator, config, result, parent_
       and result() then
       result()
       return
-   end
-
+   elseif not modpol.modules[module_slug] then
    -- if module doesn't exist, abort
-   if not modpol.modules[module_slug] then
       modpol.ocutil.log('Error in ' .. self.name .. ':call_module -> module "' .. tostring(module_slug) .. '" not found')
-        return
-    end
-
-    local index = #self.processes + 1
+      return
+   end
 
-    local module = modpol.modules[module_slug]
+   local index = #self.processes + 1
+   
+   local module = modpol.modules[module_slug]
 
     -- first applies any relevant org policies
     -- then overrides with the config values given on input