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

Transition.py: fix the problem that guard doesn't workflow for automatic method.

parent c578e448
......@@ -1045,7 +1045,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
if hot_reindexing:
setattr(app,'isIndexable', 1)
portal.portal_catalog.manage_hotReindexAll()
self.dynamicalWorkflowConversion()
#self.dynamicalWorkflowConversion()
portal.portal_types.resetDynamicDocumentsOnceAtTransactionBoundary()
self.getPortal().erp5_sql_connection.manage_test("update message_queue set processing_node=0, priority=1 where processing_node=-1")
self.getPortal().erp5_sql_connection.manage_test("update message set processing_node=0, priority=2 where processing_node=-1")
......
......@@ -92,18 +92,17 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
return self.guard
def generateGuard(self):
if self.trigger_type == TRIGGER_USER_ACTION:
if self.guard is None:
self.guard = Guard(permissions=self.getPermissionList(),
roles=self.getRoleList(),
groups=self.getGroupList(),
expr=Expression(self.getExpression()))
if self.guard is None:
self.guard = Guard(permissions=self.getPermissionList(),
roles=self.getRoleList(),
groups=self.getGroupList(),
expr=Expression(self.getExpression()))
if self.getRoleList() is not None:
self.guard.roles = self.getRoleList()
if self.getPermissionList() is not None:
self.guard.permissions = self.getPermissionList()
if self.getGroupList() is not None:
self.guard.groups = self.getGroupList()
if self.getExpression() is not None:
self.guard.expr = Expression(self.getExpression())
if self.getRoleList() is not None:
self.guard.roles = self.getRoleList()
if self.getPermissionList() is not None:
self.guard.permissions = self.getPermissionList()
if self.getGroupList() is not None:
self.guard.groups = self.getGroupList()
if self.getExpression() is not None:
self.guard.expr = Expression(self.getExpression())
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