mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 04:27:16 +02:00
Homogenize return from ServerSession.get_puppet/account. Resolve #3100
This commit is contained in:
parent
f3f8a2413b
commit
798272f985
1 changed files with 5 additions and 10 deletions
|
|
@ -10,15 +10,10 @@ import time
|
|||
|
||||
from django.conf import settings
|
||||
from django.utils import timezone
|
||||
|
||||
from evennia.commands.cmdsethandler import CmdSetHandler
|
||||
from evennia.comms.models import ChannelDB
|
||||
from evennia.scripts.monitorhandler import MONITOR_HANDLER
|
||||
from evennia.typeclasses.attributes import (
|
||||
AttributeHandler,
|
||||
DbHolder,
|
||||
InMemoryAttributeBackend,
|
||||
)
|
||||
from evennia.typeclasses.attributes import AttributeHandler, DbHolder, InMemoryAttributeBackend
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import class_from_module, lazy_property, make_iter
|
||||
|
||||
|
|
@ -155,20 +150,20 @@ class ServerSession(_BASE_SESSION_CLASS):
|
|||
Get the account associated with this session
|
||||
|
||||
Returns:
|
||||
account (Account): The associated Account.
|
||||
account (Account or None): The associated Account.
|
||||
|
||||
"""
|
||||
return self.logged_in and self.account
|
||||
return self.account if self.logged_in else None
|
||||
|
||||
def get_puppet(self):
|
||||
"""
|
||||
Get the in-game character associated with this session.
|
||||
|
||||
Returns:
|
||||
puppet (Object): The puppeted object, if any.
|
||||
puppet (Object or None): The puppeted object, if any.
|
||||
|
||||
"""
|
||||
return self.logged_in and self.puppet
|
||||
return self.puppet if self.logged_in else None
|
||||
|
||||
get_character = get_puppet
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue