Commit 713e8a43 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

WorkflowTool: skip worklists without reference when computing

Otherwise we get an error when just adding a worklist
parent b300091e
......@@ -255,6 +255,34 @@ class TestWorklist(TestWorkflowMixin):
self.worklist_int_variable_id,
])
def test_edit_worklist_view(self):
"""Checks we can view and edit worklist.
"""
def check_visible(worklist):
self.clearCache()
worklist.view()
workflow_value = self.getWorkflowTool()[self.checked_workflow]
# edit reference first
worklist_value = workflow_value.newContent(portal_type='Worklist')
check_visible(worklist_value)
worklist_value.setReference(self.worklist_assignor_id)
check_visible(worklist_value)
worklist_value.setActionName('Test (%(count)s)')
worklist_value.setAction('/')
worklist_value.setActionType('global')
check_visible(worklist_value)
# edit reference last
worklist_value = workflow_value.newContent(portal_type='Worklist')
check_visible(worklist_value)
worklist_value.setActionName('Test (%(count)s)')
worklist_value.setAction('/')
worklist_value.setActionType('global')
check_visible(worklist_value)
worklist_value.setReference(self.worklist_owner_id)
check_visible(worklist_value)
def test_01_permission(self, quiet=0, run=run_all_test):
"""
Test the permission of the building module.
......
......@@ -755,6 +755,8 @@ def groupWorklistListByCondition(worklist_dict, sql_catalog,
metadata_dict = {}
for workflow_id, worklist in six.iteritems(worklist_dict):
for worklist_id, worklist_match_dict in six.iteritems(worklist):
if not worklist_id:
continue
workflow_worklist_key = '/'.join((workflow_id, worklist_id))
if getSecurityUidDictAndRoleColumnDict is None:
valid_criterion_dict, metadata = getValidCriterionDict(
......
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