Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #16403 -- Correctly use ungettext in comments form. Thanks, poi…

…rier.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16505 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c6ae0fa549a250fb862436587c88ae6ad81da90c 1 parent 7db68a8
Jannis Leidel jezdez authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 django/contrib/comments/forms.py
5 django/contrib/comments/forms.py
View
@@ -173,11 +173,10 @@ def clean_comment(self):
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):
Please sign in to comment.
Something went wrong with that request. Please try again.