Commit 36c7b492 authored by Vincent Pelletier's avatar Vincent Pelletier

Allow getSecurityUidListAndRoleColumnDict to be None in groupWorklistListByCondition (part 2 of 2)

 - replace factorisale code by method calls


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17365 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7f2b822b
...@@ -193,7 +193,11 @@ def groupWorklistListByCondition(worklist_dict, acceptable_key_dict, ...@@ -193,7 +193,11 @@ def groupWorklistListByCondition(worklist_dict, acceptable_key_dict,
# worklists if possible at all. # worklists if possible at all.
for security_column_id, security_column_value in \ for security_column_id, security_column_value in \
role_column_dict.iteritems(): role_column_dict.iteritems():
valid_criterion_dict = {} valid_criterion_dict, metadata = getValidCriterionDict(
worklist_match_dict=worklist_match_dict,
acceptable_key_dict=acceptable_key_dict)
if metadata is not None:
metadata_dict[workflow_worklist_key] = metadata
valid_criterion_dict.update(applied_security_criterion_dict) valid_criterion_dict.update(applied_security_criterion_dict)
# Current security criterion must be applied to all further queries # Current security criterion must be applied to all further queries
# for this worklist negated, so the a given line cannot match multiple # for this worklist negated, so the a given line cannot match multiple
...@@ -201,29 +205,10 @@ def groupWorklistListByCondition(worklist_dict, acceptable_key_dict, ...@@ -201,29 +205,10 @@ def groupWorklistListByCondition(worklist_dict, acceptable_key_dict,
applied_security_criterion_dict[security_column_id] = \ applied_security_criterion_dict[security_column_id] = \
ExclusionList(security_column_value) ExclusionList(security_column_value)
valid_criterion_dict[security_column_id] = security_column_value valid_criterion_dict[security_column_id] = security_column_value
for criterion_id, criterion_value in worklist_match_dict.iteritems(): updateWorklistSetDict(
if criterion_id in acceptable_key_dict: worklist_set_dict=worklist_set_dict,
if isinstance(criterion_value, tuple): workflow_worklist_key=workflow_worklist_key,
criterion_value = list(criterion_value) valid_criterion_dict=valid_criterion_dict)
assert criterion_id not in valid_criterion_dict
valid_criterion_dict[criterion_id] = criterion_value
elif criterion_id == WORKLIST_METADATA_KEY:
metadata_dict[workflow_worklist_key] = criterion_value
elif criterion_id == SECURITY_PARAMETER_ID:
pass
else:
LOG('WorkflowTool_listActions', WARNING, 'Worklist %s of ' \
'workflow %s filters on variable %s which is not available ' \
'in catalog. Its value will not be checked.' % \
(worklist_id, workflow_id, criterion_id))
worklist_set_dict_key = valid_criterion_dict.keys()
if len(worklist_set_dict_key):
worklist_set_dict_key.sort()
worklist_set_dict_key = tuple(worklist_set_dict_key)
if worklist_set_dict_key not in worklist_set_dict:
worklist_set_dict[worklist_set_dict_key] = {}
worklist_set_dict[worklist_set_dict_key]\
[workflow_worklist_key] = valid_criterion_dict
return worklist_set_dict.values(), metadata_dict return worklist_set_dict.values(), metadata_dict
def generateNestedQuery(priority_list, criterion_dict, def generateNestedQuery(priority_list, criterion_dict,
......
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