Removed child org from parent children list

This commit is contained in:
Nathan Schneider
2022-08-26 15:59:38 -07:00
parent ec0e4aa9c1
commit 13eb58a3ee
5 changed files with 42 additions and 18 deletions

View File

@ -137,11 +137,15 @@ function modpol.interactions.org_dashboard(user, org_string)
-- prepare children menu
local children = {}
for k,v in ipairs(org.children) do
local this_child = modpol.orgs.get_org(v)
table.insert(children, this_child.name)
if org.children then
for k,v in ipairs(org.children) do
local this_child = modpol.orgs.get_org(v)
if this_child then
table.insert(children, this_child.name)
end
end
table.sort(children)
end
table.sort(children)
-- prepare modules menu
local modules = {}