this should have been in 3.0.1
authorsylvain.thenault@logilab.fr
Mon, 12 Jan 2009 15:12:51 +0100
changeset 389 aa180daa2bd4
parent 388 4e23b542f8ad
child 390 739d12586b9d
this should have been in 3.0.1
server/querier.py
server/test/unittest_security.py
--- a/server/querier.py	Mon Jan 12 11:00:17 2009 +0100
+++ b/server/querier.py	Mon Jan 12 15:12:51 2009 +0100
@@ -44,6 +44,7 @@
     for rel in restriction.iget_nodes(Relation):
         cmp = rel.children[1]
         if rel.r_type == 'eid' and cmp.operator == '=' and \
+               not rel.neged(strict=True) and \
                isinstance(cmp.children[0], Constant) and \
                cmp.children[0].type == 'Substitute':
             varkwargs[rel.children[0].name] = typed_eid(cmp.children[0].eval(args))
--- a/server/test/unittest_security.py	Mon Jan 12 11:00:17 2009 +0100
+++ b/server/test/unittest_security.py	Mon Jan 12 15:12:51 2009 +0100
@@ -253,7 +253,7 @@
         self.assertEquals(rset.rows, [[aff2]])
         # more cache test w/ NOT eid
         rset = cu.execute('Affaire X WHERE NOT X eid %(x)s', {'x': eid}, 'x')
-        self.assertEquals(rset.rows, [])
+        self.assertEquals(rset.rows, [[aff2]])
         rset = cu.execute('Affaire X WHERE NOT X eid %(x)s', {'x': aff2}, 'x')
         self.assertEquals(rset.rows, [])