Add hyperlink to User field renderer

This commit is contained in:
Lance Edgar 2017-01-29 22:52:36 -06:00
parent 709fd5200d
commit 2ab2dfe26b

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2016 Lance Edgar
# Copyright © 2010-2017 Lance Edgar
#
# This file is part of Rattail.
#
@ -44,7 +44,10 @@ class UserFieldRenderer(formalchemy.TextFieldRenderer):
user = self.raw_value
if not user:
return ''
return user.display_name
title = user.display_name
if self.request.has_perm('users.view'):
return tags.link_to(title, self.request.route_url('users.view', uuid=user.uuid))
return title
def PermissionsFieldRenderer(permissions, include_guest=False, include_authenticated=False):