Exemple #1
0
 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
Exemple #2
0
 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_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
Exemple #5
0
 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
Exemple #6
0
 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
Exemple #7
0
 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
Exemple #8
0
 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