# HG changeset patch # User Sylvain Thénault # Date 1310031235 -7200 # Node ID ae4cb4153490817a6f9bad77a2a3beea789908fe # Parent ce020f90fb8e1fd9a0a1b09fc57352273e16fd10 [facet] with rql path facet rel may be None, handle it diff -r ce020f90fb8e -r ae4cb4153490 web/facet.py --- a/web/facet.py Thu Jul 07 11:33:39 2011 +0200 +++ b/web/facet.py Thu Jul 07 11:33:55 2011 +0200 @@ -750,9 +750,13 @@ self._and_restriction(rel, restrvar, value.pop()) def _and_restriction(self, rel, restrvar, value): - rrel = nodes.make_constant_restriction(restrvar, self.restr_attr, - value, self.restr_attr_type) - rel.parent.replace(rel, nodes.And(rel, rrel)) + if rel is None: + self.select.add_constant_restriction(restrvar, self.restr_attr, + value, self.restr_attr_type) + else: + rrel = nodes.make_constant_restriction(restrvar, self.restr_attr, + value, self.restr_attr_type) + rel.parent.replace(rel, nodes.And(rel, rrel)) @cached