Fixes to player creation that may not actually do anything. Also add default flagged channels with the default alias being the first three characters of the channel's name.

This commit is contained in:
Greg Taylor 2009-01-22 03:50:16 +00:00
parent 4c562cd6ce
commit f0c129f730
3 changed files with 22 additions and 3 deletions

View file

@ -343,6 +343,8 @@ class ObjectManager(models.Manager):
user = User.objects.create_user(uname, email, password)
# It stinks to have to do this but it's the only trivial way now.
user.save()
# Update the session to use the newly created User object's ID.
session.uid = user.id
# We can't use the user model to change the id because of the way keys
# are handled, so we actually need to fall back to raw SQL. Boo hiss.
@ -367,3 +369,4 @@ class ObjectManager(models.Manager):
session.msg("Welcome to %s, %s.\n\r" % (
ConfigValue.objects.get_configvalue('site_name'),
session.get_pobject().get_name(show_dbref=False)))
session.add_default_channels()

View file

@ -976,6 +976,12 @@ class CommChannel(models.Model):
# They've failed to meet any of the above conditions.
return False
def get_default_chan_alias(self):
"""
Returns a default channel alias for the channel if none is provided.
"""
return self.name[:3].lower()
class CommChannelAdmin(admin.ModelAdmin):
list_display = ('name', 'owner')