Commit 046d5d3c authored by Jérome Perrin's avatar Jérome Perrin

WorkflowTool: py3

parent 2970f8f4
...@@ -839,7 +839,7 @@ def generateNestedQuery(getQuery, priority_list, criterion_dict, ...@@ -839,7 +839,7 @@ def generateNestedQuery(getQuery, priority_list, criterion_dict,
criterion_worklist_id_dict = worklist_id_dict.copy() criterion_worklist_id_dict = worklist_id_dict.copy()
# Do not use iterkeys since the dictionary will be modified in the # Do not use iterkeys since the dictionary will be modified in the
# loop # loop
for worklist_id in criterion_worklist_id_dict.keys(): for worklist_id in list(criterion_worklist_id_dict):
if worklist_id not in possible_worklist_id_dict: if worklist_id not in possible_worklist_id_dict:
del criterion_worklist_id_dict[worklist_id] del criterion_worklist_id_dict[worklist_id]
else: else:
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# #
############################################################################## ##############################################################################
import six
from Products.ERP5Type.Workflow import WorkflowHistoryList as NewWorkflowHistoryList from Products.ERP5Type.Workflow import WorkflowHistoryList as NewWorkflowHistoryList
class WorkflowHistoryList(NewWorkflowHistoryList): class WorkflowHistoryList(NewWorkflowHistoryList):
...@@ -22,13 +23,16 @@ class WorkflowHistoryList(NewWorkflowHistoryList): ...@@ -22,13 +23,16 @@ class WorkflowHistoryList(NewWorkflowHistoryList):
def __getstate__(self): def __getstate__(self):
return self._prev, self._log return self._prev, self._log
def __nonzero__(self): def __bool__(self):
# not faster than __len__ but avoids migration # not faster than __len__ but avoids migration
if self._log: if self._log:
return True return True
assert self._prev is None assert self._prev is None
return False return False
if six.PY2:
__nonzero__ = __bool__
@property @property
def _rotate(self): def _rotate(self):
self._migrate() self._migrate()
......
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