'We are on a person record so we need to find the associated user
account.
@return: dictionary with ID and username/email of the user account'

def get_user(self):

    settings = current.auth.settings
    utable = settings.table_user
    ptable = current.s3db.pr_person_user
    pe_id = int(self.request.record.pe_id)
    userfield = settings.login_userfield
    query = ((ptable.pe_id == pe_id) & (ptable.user_id == utable.id))
    record = current.db(query).select(utable.id, utable[userfield], limitby=(0, 1)).first()
    return (dict(id=record.id, name=record[utable[userfield]]) if record else None)
