Commit fde9cccc authored by Arnaud Fontaine's avatar Arnaud Fontaine

Add missing condition checks for filesystem Constraints



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40917 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ad08a354
...@@ -61,6 +61,9 @@ class AccountTypeConstraint(Constraint): ...@@ -61,6 +61,9 @@ class AccountTypeConstraint(Constraint):
def checkConsistency(self, obj, fixit=0): def checkConsistency(self, obj, fixit=0):
"""Implement here the consistency checker """Implement here the consistency checker
""" """
if not self._checkConstraintCondition(obj):
return []
errors = [] errors = []
if getattr(obj, 'getAccountType', _MARKER) is _MARKER: if getattr(obj, 'getAccountType', _MARKER) is _MARKER:
errors.append(self._generateError( errors.append(self._generateError(
......
...@@ -37,6 +37,9 @@ class BudgetConsumptionFeasability(Constraint): ...@@ -37,6 +37,9 @@ class BudgetConsumptionFeasability(Constraint):
""" """
Check if there is enough budget to consumed. Check if there is enough budget to consumed.
""" """
if not self._checkConstraintCondition(object):
return []
errors = [] errors = []
new_category_list = [] new_category_list = []
......
...@@ -58,6 +58,9 @@ class DocumentReferenceConstraint(Constraint): ...@@ -58,6 +58,9 @@ class DocumentReferenceConstraint(Constraint):
""" """
Implement here the consistency checker Implement here the consistency checker
""" """
if not self._checkConstraintCondition(document):
return []
# XXX we probably could check reference syntax here, based on regexp in # XXX we probably could check reference syntax here, based on regexp in
# preferences? # preferences?
error_list = [] error_list = []
......
...@@ -57,6 +57,9 @@ class ResourceMeasuresConsistency(Constraint): ...@@ -57,6 +57,9 @@ class ResourceMeasuresConsistency(Constraint):
def checkConsistency(self, obj, fixit=0): def checkConsistency(self, obj, fixit=0):
"""Implement here the consistency checker """Implement here the consistency checker
""" """
if not self._checkConstraintCondition(obj):
return []
error_list = [] error_list = []
portal = obj.getPortalObject() portal = obj.getPortalObject()
......
...@@ -45,6 +45,9 @@ class TradeModelLineCellConsistency(Constraint): ...@@ -45,6 +45,9 @@ class TradeModelLineCellConsistency(Constraint):
""" """
Implement here the consistency checker Implement here the consistency checker
""" """
if not self._checkConstraintCondition(document):
return []
error_list = [] error_list = []
base_id = self.constraint_definition['base_id'] base_id = self.constraint_definition['base_id']
for cell_coordinates in document.getCellKeyList(base_id=base_id): for cell_coordinates in document.getCellKeyList(base_id=base_id):
......
...@@ -39,6 +39,9 @@ class TransactionQuantityValueFeasability(Constraint): ...@@ -39,6 +39,9 @@ class TransactionQuantityValueFeasability(Constraint):
Check if the quantity of the transaction is possible Check if the quantity of the transaction is possible
for the source and the destination for the source and the destination
""" """
if not self._checkConstraintCondition(object):
return []
errors = [] errors = []
source_cell = object.getSourceValue() source_cell = object.getSourceValue()
destination_cell = object.getDestinationValue() destination_cell = object.getDestinationValue()
......
...@@ -38,6 +38,9 @@ class TransactionQuantityValueValidity(Constraint): ...@@ -38,6 +38,9 @@ class TransactionQuantityValueValidity(Constraint):
Check if the quantity of the transaction is greater than the Check if the quantity of the transaction is greater than the
balance of the source. balance of the source.
""" """
if not self._checkConstraintCondition(object):
return []
errors = [] errors = []
source_cell = object.getSourceValue() source_cell = object.getSourceValue()
......
...@@ -78,6 +78,9 @@ class PropertyTypeValidity(Constraint): ...@@ -78,6 +78,9 @@ class PropertyTypeValidity(Constraint):
def checkConsistency(self, obj, fixit=0): def checkConsistency(self, obj, fixit=0):
"""Check the object's consistency. """Check the object's consistency.
""" """
if not self._checkConstraintCondition(obj):
return []
error_list = [] error_list = []
# For each attribute name, we check type # For each attribute name, we check type
for prop in obj.propertyMap(): for prop in obj.propertyMap():
......
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