Commit 4c10f955 authored by wenjie.zheng's avatar wenjie.zheng

Worklist.py: in updateDynamicVariable, replace slef.var_matched with a...

Worklist.py: in updateDynamicVariable, replace slef.var_matched with a function's attribute, this modification resolve the duplicated listing of variables.
parent ef598466
......@@ -111,6 +111,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
def updateDynamicVariable(self):
# keep worklist variables updating, correspond to workflow variables.
res = []
for variable_value in self.getParentValue().objectValues(portal_type="Variable"):
variable_id = variable_value.getId()
worklist_variable_value = self._getOb(variable_id, None)
......@@ -120,10 +121,14 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
worklist_variable_value.setReference(variable_value_ref)
worklist_variable_value.setDefaultExpr(variable_value.getDefaultExpr())
worklist_variable_value.setInitialValue(variable_value.getInitialValue())
self.var_matches.append(worklist_variable_value)
elif worklist_variable_value in self.var_matches and variable_value.for_catalog == 0:
self.var_matches.remove(worklist_variable_value)
return self.var_matches
res.append(worklist_variable_value)
elif worklist_variable_value not in res and variable_value.for_catalog == 1:
res.append(worklist_variable_value)
if worklist_variable_value in res and variable_value.for_catalog == 0:
res.remove(worklist_variable_value)
self._delObject(variable_id)
return res
def getVarMatchKeys(self):
key_list = []
......@@ -139,7 +144,6 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
def getVarMatch(self, id):
""" return value of matched keys"""
self.var_matches = {}
matches = None
matches_ref_list = []
if id == 'portal_type':
......
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