Commit d2aad094 authored by Vincent Pelletier's avatar Vincent Pelletier

Fix an error in query generation when there is just one criterion in worklist...

Fix an error in query generation when there is just one criterion in worklist (including security criterion if any).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17477 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0b9a3c20
...@@ -251,9 +251,10 @@ def generateNestedQuery(priority_list, criterion_dict, ...@@ -251,9 +251,10 @@ def generateNestedQuery(priority_list, criterion_dict,
else: else:
possible_value_list = tuple() possible_value_list = tuple()
impossible_value_list = tuple() impossible_value_list = tuple()
if possible_worklist_id_dict is not None: possible = True
for criterion_value, criterion_worklist_id_dict \ for criterion_value, criterion_worklist_id_dict \
in my_criterion_dict.iteritems(): in my_criterion_dict.iteritems():
if possible_worklist_id_dict is not None:
possible = False possible = False
for worklist_id in criterion_worklist_id_dict.iterkeys(): for worklist_id in criterion_worklist_id_dict.iterkeys():
if worklist_id in possible_worklist_id_dict: if worklist_id in possible_worklist_id_dict:
...@@ -264,8 +265,6 @@ def generateNestedQuery(priority_list, criterion_dict, ...@@ -264,8 +265,6 @@ def generateNestedQuery(priority_list, criterion_dict,
impossible_value_list += criterion_value impossible_value_list += criterion_value
else: else:
possible_value_list += criterion_value possible_value_list += criterion_value
else:
possible_value_list = my_criterion_dict.keys()
value_query_list = [] value_query_list = []
if len(possible_value_list): if len(possible_value_list):
query = Query(operator='IN', **{my_criterion_id: possible_value_list}) query = Query(operator='IN', **{my_criterion_id: possible_value_list})
......
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