def clean(self):
        cleaned_data = super(AbstractSinglePreferenceForm, self).clean()
        try:
            self.instance.name, self.instance.section = cleaned_data['name'], cleaned_data['section']
        except __HOLE__: # changelist form
            pass
        try:
            self.instance.preference
        except NotFoundInRegistry:
            raise ValidationError(NotFoundInRegistry.detail_default)
        return self.cleaned_data
dataset/ETHPy150Open EliotBerriot/django-dynamic-preferences/dynamic_preferences/forms.py/AbstractSinglePreferenceForm.clean