Fix user field rendering when no person associated
This commit is contained in:
parent
b76f568d7d
commit
f6d9f7a913
|
@ -26,6 +26,8 @@ User Field Renderers
|
||||||
|
|
||||||
from __future__ import unicode_literals, absolute_import
|
from __future__ import unicode_literals, absolute_import
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
from rattail.db import model
|
from rattail.db import model
|
||||||
from rattail.db.auth import has_permission, administrator_role
|
from rattail.db.auth import has_permission, administrator_role
|
||||||
|
|
||||||
|
@ -44,7 +46,7 @@ class UserFieldRenderer(formalchemy.TextFieldRenderer):
|
||||||
user = self.raw_value
|
user = self.raw_value
|
||||||
if not user:
|
if not user:
|
||||||
return ''
|
return ''
|
||||||
title = user.display_name
|
title = six.text_type(user)
|
||||||
if kwargs.get('hyperlink') and self.request.has_perm('users.view'):
|
if kwargs.get('hyperlink') and self.request.has_perm('users.view'):
|
||||||
return tags.link_to(title, self.request.route_url('users.view', uuid=user.uuid))
|
return tags.link_to(title, self.request.route_url('users.view', uuid=user.uuid))
|
||||||
return title
|
return title
|
||||||
|
|
Loading…
Reference in a new issue