def clean_name(self): object_class = self.instance.__class__ name = self.cleaned_data["name"] if synonym_exists(object_class, name): raise ValidationError("A synonym of that name already exists") return self.cleaned_data["name"]
def clean_name(self): object_class = self.instance.__class__ name = self.cleaned_data["name"] if synonym_exists(object_class, name): raise ValidationError( "A synonym of that name already exists" ) return self.cleaned_data["name"]