Commit 679a77bb authored by Romain Courteaud's avatar Romain Courteaud

Do not add security_uid_list if empty.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25202 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 127f62bd
......@@ -596,8 +596,16 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
if security_uid_list:
query = ComplexQuery(Query(security_uid=security_uid_list, operator='IN'),
query, operator='OR')
else:
elif security_uid_list:
query = Query(security_uid=security_uid_list, operator='IN')
else:
# XXX A false query has to be generated.
# As it is not possible to use SQLKey for now, pass impossible value
# on uid (which will be detected as False by MySQL, as it is not in the
# column range)
# Do not pass security_uid_list as empty in order to prevent useless
# overhead
query = Query(uid=-1)
if local_role_column_dict:
query_list = []
......
......@@ -1669,6 +1669,12 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# if we specify local_roles= it will only returns documents on with bob has
# a local roles
self.assertEquals(0,
len(ctool.searchResults(title='Object Title',
local_roles='UnexistingRole')))
self.assertEquals(0,
len(ctool.searchResults(title='Object Title',
local_roles='Assignor')))
self.assertEquals(1,
len(ctool.searchResults(title='Object Title',
local_roles='Assignee')))
......
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