diff --git a/django/contrib/comments/forms.py b/django/contrib/comments/forms.py index d497572488e..bdeac993153 100644 --- a/django/contrib/comments/forms.py +++ b/django/contrib/comments/forms.py @@ -173,11 +173,10 @@ class CommentDetailsForm(CommentSecurityForm): 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 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')) + "Watch your mouth! The words %s are not allowed here.", len(bad_words)) + % get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in bad_words], 'and')) return comment class CommentForm(CommentDetailsForm):