[facet] don't crash in rset_vocabulary if an unauthorized error was raised in rqlexec stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 13 Apr 2010 15:46:44 +0200
branchstable
changeset 5225 9ff0dee81eb2
parent 5222 ed6905d98a5e
child 5226 2e215efcc3a6
[facet] don't crash in rset_vocabulary if an unauthorized error was raised in rqlexec
web/facet.py
--- a/web/facet.py	Mon Apr 12 19:36:51 2010 +0200
+++ b/web/facet.py	Tue Apr 13 15:46:44 2010 +0200
@@ -379,7 +379,9 @@
                 return ()
         finally:
             rqlst.recover()
-        return self.rset_vocabulary(rset)
+        # don't call rset_vocabulary on empty result set, it may be an empty
+        # *list* (see rqlexec implementation)
+        return rset and self.rset_vocabulary(rset)
 
     def possible_values(self):
         """return a list of possible values (as string since it's used to
@@ -468,7 +470,9 @@
                 return ()
         finally:
             rqlst.recover()
-        return self.rset_vocabulary(rset)
+        # don't call rset_vocabulary on empty result set, it may be an empty
+        # *list* (see rqlexec implementation)
+        return rset and self.rset_vocabulary(rset)
 
     def rset_vocabulary(self, rset):
         _ = self._cw._