mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 08:16:30 +01:00
Part 1 of initial database population re-factor, along with a comsys model change. DO NOT UPDATE TO THIS IN PRODUCTION ENVIRONMENTS YET! Wait for the all-clear.
This commit is contained in:
parent
8ebea8c22e
commit
c0ebbc3967
6 changed files with 29 additions and 10 deletions
|
|
@ -240,16 +240,17 @@ def get_cobj_from_name(cname):
|
|||
"""
|
||||
return CommChannel.objects.get(name=cname)
|
||||
|
||||
def create_channel(name, owner):
|
||||
def create_channel(name, owner, description=None):
|
||||
"""
|
||||
Create a new channel.
|
||||
name: (string) Name of the new channel
|
||||
owner: (Object) Objec that owns the channel
|
||||
owner: (Object) Object that owns the channel
|
||||
"""
|
||||
new_chan = CommChannel()
|
||||
new_chan.name = ansi.parse_ansi(name, strip_ansi=True)
|
||||
new_chan.ansi_name = "[%s]" % (ansi.parse_ansi(name),)
|
||||
new_chan.set_owner(owner)
|
||||
new_chan.description = description
|
||||
new_chan.save()
|
||||
return new_chan
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue