Commit 2ac7d519 authored by Jérome Perrin's avatar Jérome Perrin

Make sure non editable FloatField text is not escaped.

FloatField.format_value should not fail if value is None.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11870 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6890aa5c
No related merge requests found
......@@ -1040,7 +1040,8 @@ class FloatWidget(TextWidget):
value += value_list[1]
if percent:
value += '%'
return value.strip()
return value.strip()
return ''
def render(self, field, key, value, REQUEST):
"""Render Float input field
......@@ -1081,7 +1082,10 @@ class FloatWidget(TextWidget):
if extra not in (None, ''):
value = "<div %s>%s</div>" % (extra, value)
return TextWidgetInstance.render_view(field, value)
css_class = field.get_value('css_class')
if css_class not in ('', None):
return "<span class='%s'>%s</span>" % (css_class, value)
return value
def render_pdf(self, field, value):
"""Render the field as PDF."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment