Esempio n. 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
Esempio n. 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
Esempio n. 3
0
 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
Esempio n. 4
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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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