Add hyperlink to User field renderer
This commit is contained in:
parent
709fd5200d
commit
2ab2dfe26b
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Rattail -- Retail Software Framework
|
# Rattail -- Retail Software Framework
|
||||||
# Copyright © 2010-2016 Lance Edgar
|
# Copyright © 2010-2017 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Rattail.
|
# This file is part of Rattail.
|
||||||
#
|
#
|
||||||
|
@ -44,7 +44,10 @@ class UserFieldRenderer(formalchemy.TextFieldRenderer):
|
||||||
user = self.raw_value
|
user = self.raw_value
|
||||||
if not user:
|
if not user:
|
||||||
return ''
|
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):
|
def PermissionsFieldRenderer(permissions, include_guest=False, include_authenticated=False):
|
||||||
|
|
Loading…
Reference in a new issue