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
        i = cleaned_data.get('instance')
        if i:
            self.instance.instance = i
            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/SinglePerInstancePreferenceForm.clean