def clean_description(self): description = self.cleaned_data['description'] normalized = clean_nl(description) if remove_links(normalized) != normalized: # There's some links, we don't want them. raise forms.ValidationError(_('No links are allowed.')) return description
def clean_bio(self): bio = self.cleaned_data['bio'] normalized = clean_nl(unicode(bio)) if remove_links(normalized) != normalized: # There's some links, we don't want them. raise forms.ValidationError(_('No links are allowed.')) return bio