More bugfixes on displays and interactions, mainly fixing damage done two commits ago

This commit is contained in:
Nathan Schneider 2021-12-29 22:25:28 -07:00
parent 6c9353d389
commit 1a6f27f2f6
2 changed files with 12 additions and 2 deletions

View File

@ -29,11 +29,20 @@ function display_processes:initiate(result)
input = "Org: "..v.org.name..
", initiator: "..v.initiator
table.insert(display_table, input)
if v.config
if v.config
and modpol.util.num_pairs(v.config) > 0 then
table.insert(display_table, "Policies:")
for k2,v2 in pairs(v.config) do
input = k2..": "..v2
local v2_string = ""
if type(v2) ~= "string"
and type(v2) ~= "table" then
v2_string = tostring(v2)
elseif type(v2) == "table" then
v2_string = table.concat(v2)
else
v2_string = "Could not render"
end
input = k2..": "..v2_string
table.insert(display_table, input)
end
end

View File

@ -50,6 +50,7 @@ function modpol.interactions.dashboard(user)
local all_users = modpol.instance:list_members()
-- pending list
local user_pending_count = 0
local user_pending = {}
for k,v in ipairs(modpol.orgs.array) do
if v.pending and v.pending[user] then
if modpol.util.num_pairs(v.pending[user]) ~= 0 then