parameters: (self)
return_statement: return comment
docstring: If COMMENTS_ALLOW_PROFANITIES is False, check that the comment doesn't
          contain anything in PROFANITIES_LIST.
docstring_summary: If COMMENTS_ALLOW_PROFANITIES is False, check that the comment doesn't
          contain anything in PROFANITIES_LIST.
docstring_tokens: If COMMENTS_ALLOW_PROFANITIES is False check that the comment doesn t contain anything in PROFANITIES_LIST .
function: def clean_comment(self):
          """
          If COMMENTS_ALLOW_PROFANITIES is False, check that the comment doesn't
          contain anything in PROFANITIES_LIST.
          """
  
          if not self.request.user.is_authenticated():
              raise django_forms.ValidationError(ungettext("You must be authenticated to post a comment"))
  
          comment = self.cleaned_data["comment"]
          if settings.COMMENTS_ALLOW_PROFANITIES == False:
              bad_words = [w for w in settings.PROFANITIES_LIST if w in comment.lower()]
              if bad_words:
                  plural = len(bad_words) > 1
                  raise django_forms.ValidationError(ungettext(
                      "Watch your mouth! The word %s is not allowed here.",
                      "Watch your mouth! The words %s are not allowed here.", plural) % \
                      get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in bad_words], 'and'))
  
          return comment
function_tokens: def clean_comment ( self ) : if not self . request . user . is_authenticated ( ) : raise django_forms . ValidationError ( ungettext ( "You must be authenticated to post a comment" ) ) comment = self . cleaned_data [ "comment" ] if settings . COMMENTS_ALLOW_PROFANITIES == False : bad_words = [ w for w in settings . PROFANITIES_LIST if w in comment . lower ( ) ] if bad_words : plural = len ( bad_words ) > 1 raise django_forms . ValidationError ( ungettext ( "Watch your mouth! The word %s is not allowed here." , "Watch your mouth! The words %s are not allowed here." , plural ) % get_text_list ( [ '"%s%s%s"' % ( i [ 0 ] , '-' * ( len ( i ) - 2 ) , i [ - 1 ] ) for i in bad_words ] , 'and' ) ) return comment