def clean_public(self):
        data = self.cleaned_data['public']
        # Returned data depends on PUBLIC_RADIO_CHOICES
        if data == u'public':
            return True
        elif data == u'private':
            return False
        else:
            raise forms.ValidationError(_("Choose one of the given options"))
dataset/ETHPy150Open lukaszb/django-projector/projector/forms.py/ProjectBaseForm.clean_public/original