orgs are now initialized with a founding member
This commit is contained in:
@@ -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 .. ')')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user