Commit f400b6ca authored by Alexandre Boeglin's avatar Alexandre Boeglin

if no test method is defined, the rule should not apply

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17641 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3374f22a
......@@ -119,6 +119,14 @@ class Rule(Predicate, XMLObject):
return context.get(id)
# Simulation workflow
def test(self, *args, **kw):
"""
If no test method is defined, return False, to prevent infinite loop
"""
if not self.getTestMethodId():
return False
return Predicate.test(self, *args, **kw)
security.declareProtected(Permissions.ModifyPortalContent, 'expand')
def expand(self, applied_rule, **kw):
"""
......
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