Fix grid link logic some more...

should not show link if value is None
This commit is contained in:
Lance Edgar 2019-03-06 21:03:23 -06:00
parent 40c7e34014
commit 60334229d5

View file

@ -1052,7 +1052,8 @@ class CustomWebhelpersGrid(webhelpers2_grid.Grid):
if hasattr(record, 'uuid'):
attrs['data_uuid'] = record.uuid
return HTML.tag('li', tags.link_to(value, url), **attrs)
if self.linked_columns and column_name in self.linked_columns and value != '':
if self.linked_columns and column_name in self.linked_columns and (
value is not None and value != ''):
url = self.url_generator(record, i)
value = tags.link_to(value, url)
class_name = 'c{} {}'.format(column_number, column_name)