def clean_cache_host(self):
        """Validate that the cache_host field is provided if required."""
        cache_host = self.cleaned_data['cache_host'].strip()

        if self.fields['cache_host'].required and not cache_host:
            raise ValidationError(
                _('A valid cache host must be provided.'))

        return cache_host
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/admin/forms.py/GeneralSettingsForm.clean_cache_host/original