Commit 736a4382 authored by Arnaud Fontaine's avatar Arnaud Fontaine

AttributeEqualityConstraint for ZODB Property Sheet should have always

inherited from PropertyExistenceConstraint


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41835 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent da324b53
...@@ -29,11 +29,14 @@ ...@@ -29,11 +29,14 @@
# #
############################################################################## ##############################################################################
from Products.ERP5Type.Core.PropertyExistenceConstraint import \
PropertyExistenceConstraint
from Products.ERP5Type.mixin.constraint import ConstraintMixin from Products.ERP5Type.mixin.constraint import ConstraintMixin
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
class AttributeEqualityConstraint(ConstraintMixin): class AttributeEqualityConstraint(PropertyExistenceConstraint):
""" """
This constraint checks the values of a given attribute name on this This constraint checks the values of a given attribute name on this
object. object.
...@@ -68,11 +71,10 @@ class AttributeEqualityConstraint(ConstraintMixin): ...@@ -68,11 +71,10 @@ class AttributeEqualityConstraint(ConstraintMixin):
""" """
attribute_name = self.getConstraintAttributeName() attribute_name = self.getConstraintAttributeName()
# If property does not exist, error will be raised by error = self._checkPropertyConsistency(obj, attribute_name)
# PropertyExistence Constraint, but the value has to be set at if error:
# least once as there is no need to perform any check if it is the return [error]
# default value
if obj.hasProperty(attribute_name):
identical = True identical = True
# The expected value of the attribute is a TALES Expression # The expected value of the attribute is a TALES Expression
......
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