Add User.employee convenience attribute.

This commit is contained in:
Lance Edgar 2016-01-13 02:04:11 -06:00
parent dcf0dd9b8d
commit a0492f1fac

View file

@ -120,6 +120,14 @@ class User(Base):
return self.person.display_name
return self.username
@property
def employee(self):
"""
Convenience attribute to fetch a reference to the connected
``Employee`` instance, or ``None``.
"""
return self.person.employee if self.person else None
def get_email_address(self):
"""
Returns the primary email address for the user (as unicode string), or