
from schematics.exceptions import ConversionError, ValidationError


def validate(schema, data):
    try:
        schema.import_data(data)
        schema.validate()
    except (ConversionError, ValidationError) as e:
        raise InvalidInputError(details=e.messages)


def weight_validator(value):
    if abs(value.as_tuple().exponent) > 1:
        raise ValidationError('More than one decimal exponent not allowed')

    return value


class DomainError(Exception):
    def __init__(self, message=None, details=None):
        if message: self.message = message
        if details: self.details = details


class EntityNotFoundError(DomainError):
    """Raised when an entity does not exist."""
    message = 'Entity does not exist.'


class InvalidInputError(DomainError):
    """Raised when input data is invalid."""
    message = 'Input data is invalid.'


from schematics.exceptions import ConversionError, ValidationError


def validate(schema, data):
    try:
        schema.import_data(data)
        schema.validate()
    except (ConversionError, ValidationError) as e:
        raise InvalidInputError(details=e.messages)


def weight_validator(value):
    if abs(value.as_tuple().exponent) > 1:
        raise ValidationError('Only one decimal point is allowed.')

    return value


class DomainError(Exception):
    def __init__(self, message=None, details=None):
        if message: self.message = message
        if details: self.details = details


class EntityNotFoundError(DomainError):
    """Raised when an entity does not exist."""
    message = 'Entity does not exist.'


class InvalidInputError(DomainError):
    """Raised when input data is invalid."""
    message = 'Input data is invalid.'

Change error message of the weight validator.
Change error message of the weight validator.
  
  from schematics.exceptions import ConversionError, ValidationError
  
  
  def validate(schema, data):
      try:
          schema.import_data(data)
          schema.validate()
      except (ConversionError, ValidationError) as e:
          raise InvalidInputError(details=e.messages)
  
  
  def weight_validator(value):
      if abs(value.as_tuple().exponent) > 1:
-         raise ValidationError('More than one decimal exponent not allowed')
+         raise ValidationError('Only one decimal point is allowed.')
  
      return value
  
  
  class DomainError(Exception):
      def __init__(self, message=None, details=None):
          if message: self.message = message
          if details: self.details = details
  
  
  class EntityNotFoundError(DomainError):
      """Raised when an entity does not exist."""
      message = 'Entity does not exist.'
  
  
  class InvalidInputError(DomainError):
      """Raised when input data is invalid."""
      message = 'Input data is invalid.'
  
Change error message of the weight validator.
## Code Before:

from schematics.exceptions import ConversionError, ValidationError


def validate(schema, data):
    try:
        schema.import_data(data)
        schema.validate()
    except (ConversionError, ValidationError) as e:
        raise InvalidInputError(details=e.messages)


def weight_validator(value):
    if abs(value.as_tuple().exponent) > 1:
        raise ValidationError('More than one decimal exponent not allowed')

    return value


class DomainError(Exception):
    def __init__(self, message=None, details=None):
        if message: self.message = message
        if details: self.details = details


class EntityNotFoundError(DomainError):
    """Raised when an entity does not exist."""
    message = 'Entity does not exist.'


class InvalidInputError(DomainError):
    """Raised when input data is invalid."""
    message = 'Input data is invalid.'

## Instruction:
Change error message of the weight validator.
## Code After:

from schematics.exceptions import ConversionError, ValidationError


def validate(schema, data):
    try:
        schema.import_data(data)
        schema.validate()
    except (ConversionError, ValidationError) as e:
        raise InvalidInputError(details=e.messages)


def weight_validator(value):
    if abs(value.as_tuple().exponent) > 1:
        raise ValidationError('Only one decimal point is allowed.')

    return value


class DomainError(Exception):
    def __init__(self, message=None, details=None):
        if message: self.message = message
        if details: self.details = details


class EntityNotFoundError(DomainError):
    """Raised when an entity does not exist."""
    message = 'Entity does not exist.'


class InvalidInputError(DomainError):
    """Raised when input data is invalid."""
    message = 'Input data is invalid.'
