def validate_empty_values()

in src/wagtail_localize_smartling/api/serializers.py [0:0]


    def validate_empty_values(self, data) -> tuple[bool, Any]:
        """
        Overrides the default behavior to allow `None` for the `data` field.
        """
        if "response" in data and (
            data["response"]["data"] is None
            and hasattr(self, "_acceptable_codes_for_null_response")
            and data["response"]["code"] in self._acceptable_codes_for_null_response
        ):
            # Consider this as valid for the serializer
            return True, data
        return super().validate_empty_values(data)