Commit 75530229 authored by Romain Courteaud's avatar Romain Courteaud

Prevent infinite loop if AttributeError is raised.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7640 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d46efbae
......@@ -898,6 +898,9 @@ def initializeProduct( context,
constructors = c.constructors,
icon = icon)
class ConstraintNotFound(Exception):
pass
def createConstraintList(property_holder, constraint_definition):
"""
This function creates constraint instances for a class
......@@ -910,7 +913,7 @@ def createConstraintList(property_holder, constraint_definition):
except AttributeError:
LOG("ERP5Type", PROBLEM, "Can not find Constraint: %s" % \
constraint_definition['type'])
raise
raise ConstraintNotFound
consistency_instance = consistency_class(**constraint_definition)
property_holder.constraints += [consistency_instance]
......
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