Allow product field renderer to suppress hyperlink

This commit is contained in:
Lance Edgar 2017-08-02 12:04:03 -05:00
parent b160ac64eb
commit 09ffdba9ef

View file

@ -26,6 +26,8 @@ Product Field Renderers
from __future__ import unicode_literals, absolute_import
import six
from rattail.gpc import GPC
from rattail.db import model
from rattail.db.util import maxlen
@ -57,7 +59,9 @@ class ProductFieldRenderer(AutocompleteFieldRenderer):
product = self.raw_value
if not product:
return ''
if kwargs.get('hyperlink', True):
return tags.link_to(product, self.request.route_url('products.view', uuid=product.uuid))
return six.text_type(product)
class ProductKeyFieldRenderer(TextFieldRenderer):