Commit 16ab6ee5 authored by Jérome Perrin's avatar Jérome Perrin

fix variable naming, there's no "arity" with subobjects


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18232 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 51f69e8c
...@@ -49,11 +49,9 @@ class ContentExistence(Constraint): ...@@ -49,11 +49,9 @@ class ContentExistence(Constraint):
obj = object obj = object
errors = [] errors = []
if self._checkConstraintCondition(object): if self._checkConstraintCondition(object):
# Retrieve values inside de PropertySheet (_constraints) # Retrieve configuration values from PropertySheet (_constraints)
portal_type = self.constraint_definition['portal_type'] portal_type = self.constraint_definition['portal_type']
# Check arity and compare it with the min and max if not len(obj.contentValues(portal_type=portal_type)):
arity = len(obj.contentValues(portal_type=portal_type))
if (arity == 0):
# Generate error message # Generate error message
error_message = "Does not contain any subobject" error_message = "Does not contain any subobject"
if portal_type is not (): if portal_type is not ():
...@@ -61,3 +59,4 @@ class ContentExistence(Constraint): ...@@ -61,3 +59,4 @@ class ContentExistence(Constraint):
# Add error # Add error
errors.append(self._generateError(obj, error_message)) errors.append(self._generateError(obj, error_message))
return errors return errors
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