mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 08:46:31 +01:00
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:
parent
4c562cd6ce
commit
f0c129f730
3 changed files with 22 additions and 3 deletions
|
|
@ -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()
|
||||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue