Add User.employee
convenience attribute.
This commit is contained in:
parent
dcf0dd9b8d
commit
a0492f1fac
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue