add in is_connected property to base objects

This commit is contained in:
Nicholas Matlaga 2018-02-13 12:54:03 -05:00
parent 11c9d60111
commit fad008d660

View file

@ -206,6 +206,14 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
def sessions(self):
return ObjectSessionHandler(self)
@property
def is_connected(self):
# we get an error for objects subscribed to channels without this
if self.account: # seems sane to pass on the account
return self.account.is_connected
else:
return False
@property
def has_account(self):
"""