diff --git a/tailbone/forms/renderers/employees.py b/tailbone/forms/renderers/employees.py index ead3c93a..b8c09d45 100644 --- a/tailbone/forms/renderers/employees.py +++ b/tailbone/forms/renderers/employees.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8; -*- ################################################################################ # # Rattail -- Retail Software Framework @@ -26,6 +26,7 @@ Employee Field Renderers from __future__ import unicode_literals, absolute_import +import six from webhelpers.html import tags from tailbone.forms.renderers import AutocompleteFieldRenderer @@ -41,7 +42,8 @@ class EmployeeFieldRenderer(AutocompleteFieldRenderer): employee = self.raw_value if not employee: return '' - title = unicode(employee.person) - if self.request.has_perm('employees.view'): + render_name = kwargs.get('render_name', six.text_type) + title = render_name(employee) + if kwargs.get('hyperlink') and self.request.has_perm('employees.view'): return tags.link_to(title, self.request.route_url('employees.view', uuid=employee.uuid)) return title