def clean_bio(self): bio = self.cleaned_data['bio'] normalized = clean_nl(unicode(bio)) if has_links(normalized): # There's some links, we don't want them. raise forms.ValidationError(_('No links are allowed.')) return bio
def clean_description(self): description = self.cleaned_data['description'] normalized = clean_nl(description) if has_links(normalized): # There's some links, we don't want them. raise forms.ValidationError(ugettext('No links are allowed.')) return description
def clean_biography(self): biography = self.cleaned_data['biography'] normalized = clean_nl(unicode(biography)) if has_links(normalized): # There's some links, we don't want them. raise forms.ValidationError(ugettext('No links are allowed.')) return biography
def clean_biography(self): biography = self.cleaned_data['biography'] normalized = clean_nl(six.text_type(biography)) if has_links(normalized): # There's some links, we don't want them. raise forms.ValidationError(ugettext('No links are allowed.')) return biography
def validate_description(self, value): if has_links(clean_nl(str(value))): # There's some links, we don't want them. raise serializers.ValidationError( ugettext('No links are allowed.')) return value
def validate_biography(self, value): if has_links(clean_nl(unicode(value))): # There's some links, we don't want them. raise serializers.ValidationError( ugettext(u'No links are allowed.')) return value