예제 #1
0
    def validate(self, data):
        if data == {}:
            return

        try:
            validate_schema(data)
        except SchemaValidationError as e:
            raise ValidationError(e.message)
예제 #2
0
    def validate(self, data):
        if not data or data == {}:
            return

        try:
            validate_schema(data)
        except SchemaValidationError as e:
            raise ValidationError(e.message)
예제 #3
0
파일: sentry_app.py 프로젝트: yndxz/sentry
    def to_internal_value(self, data):
        if not data:
            return

        try:
            validate_schema(data)
        except SchemaValidationError as e:
            raise ValidationError(e.message)
        return data
예제 #4
0
    def to_internal_value(self, data):
        if data is None:
            return

        if data == "" or data == {}:
            return {}

        try:
            validate_schema(data)
        except SchemaValidationError as e:
            raise ValidationError(e.message)
        return data