orgs are now initialized with a founding member

This commit is contained in:
Luke Miller
2021-06-04 00:16:10 -04:00
parent 9d81d57a54
commit 28e31eebc9
3 changed files with 45 additions and 11 deletions
+4 -1
View File
@@ -144,7 +144,7 @@ end
-- ==================================================
-- adds a new sub org to the org it is called on
-- ex: instance:add_org('town hall')
function modpol.orgs:add_org(name)
function modpol.orgs:add_org(name, user)
if self.id == nil then
modpol.ocutil.log('Error in ' .. self.name .. ':add_org -> add_org can only be called by another org')
return false
@@ -175,6 +175,9 @@ function modpol.orgs:add_org(name)
-- adding child to org list
modpol.orgs.array[child_org.id] = child_org
-- adding creator of org as the first member
child_org:add_member(user)
self:record('created sub org ' .. name, 'add_org')
modpol.ocutil.log('Created ' .. name .. ' (suborg of ' .. self.name .. ')')