(self, obj, fixit=0)
return error_list
Check the object's consistency.
Check the object's consistency.
Check the object s consistency .
def _checkConsistency(self, obj, fixit=0):
    """Check the object's consistency.
    """
    error_list = []
    # Retrieve values inside de PropertySheet (_constraints)
    base_category = self.constraint_definition['base_category']
    portal_type = self.constraint_definition['portal_type']
    membership_list = obj.getValueList(base_category,
                                       portal_type=portal_type)
    state_var_list = self.constraint_definition.copy()
    state_var_list.pop('portal_type')
    state_var_list.pop('base_category')

    for workflow_variable, valid_state_list in state_var_list.items():
      for membership in membership_list:
        current_state = membership.getProperty(workflow_variable)
        if current_state not in valid_state_list:
          mapping = dict(workflow_variable=workflow_variable,
                         membership_url=membership.getRelativeUrl(),
                         current_state=current_state,
                         valid_state_list=str(valid_state_list),)
          message_id = 'message_different_state'

          # Add error
          error_list.append(self._generateError(obj,
                                  self._getMessage(message_id), mapping))

    return error_list
def _checkConsistency ( self , obj , fixit = 0 ) : error_list = [ ] # Retrieve values inside de PropertySheet (_constraints) base_category = self . constraint_definition [ 'base_category' ] portal_type = self . constraint_definition [ 'portal_type' ] membership_list = obj . getValueList ( base_category , portal_type = portal_type ) state_var_list = self . constraint_definition . copy ( ) state_var_list . pop ( 'portal_type' ) state_var_list . pop ( 'base_category' ) for workflow_variable , valid_state_list in state_var_list . items ( ) : for membership in membership_list : current_state = membership . getProperty ( workflow_variable ) if current_state not in valid_state_list : mapping = dict ( workflow_variable = workflow_variable , membership_url = membership . getRelativeUrl ( ) , current_state = current_state , valid_state_list = str ( valid_state_list ) , ) message_id = 'message_different_state' # Add error error_list . append ( self . _generateError ( obj , self . _getMessage ( message_id ) , mapping ) ) return error_list