def clean_cache_path(self):
        cache_path = self.cleaned_data['cache_path'].strip()

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

        return cache_path
Validate that the cache_path field is provided if required.
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/admin/forms.py/GeneralSettingsForm.clean_cache_path