[facets] fix RangeFacet get_widget: do no return a widget unless there are at least 2 values; closes #1625203
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 22 Apr 2011 16:15:10 +0200
changeset 7248 f20fc41e3f7d
parent 7247 0d2ad493735b
child 7249 86bbf174e463
[facets] fix RangeFacet get_widget: do no return a widget unless there are at least 2 values; closes #1625203
web/facet.py
--- a/web/facet.py	Fri Apr 22 12:20:48 2011 +0200
+++ b/web/facet.py	Fri Apr 22 16:15:10 2011 +0200
@@ -936,7 +936,7 @@
         """return the widget instance to use to display this facet"""
         values = set(value for _, value in self.vocabulary() if value is not None)
         # Rset with entities (the facet is selected) but without values
-        if len(values) == 0:
+        if len(values) < 2:
             return None
         return self.wdgclass(self, min(values), max(values))