add in is_connected property to base objects

This commit is contained in:
Nicholas Matlaga 2018-02-13 12:54:03 -05:00 committed by Griatch
parent 861c722d30
commit 5817c1b790

View file

@ -210,6 +210,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):
"""