Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored July 04, 2011

Showing 1 changed file with 2 additions and 3 deletions. Show diff stats Hide diff stats

  1. 5  django/contrib/comments/forms.py
5  django/contrib/comments/forms.py
@@ -173,11 +173,10 @@ def clean_comment(self):
173 173
         if settings.COMMENTS_ALLOW_PROFANITIES == False:
174 174
             bad_words = [w for w in settings.PROFANITIES_LIST if w in comment.lower()]
175 175
             if bad_words:
176  
-                plural = len(bad_words) > 1
177 176
                 raise forms.ValidationError(ungettext(
178 177
                     "Watch your mouth! The word %s is not allowed here.",
179  
-                    "Watch your mouth! The words %s are not allowed here.", plural) % \
180  
-                    get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in bad_words], 'and'))
  178
+                    "Watch your mouth! The words %s are not allowed here.", len(bad_words))
  179
+                    % get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in bad_words], 'and'))
181 180
         return comment
182 181
 
183 182
 class CommentForm(CommentDetailsForm):

0 notes on commit c6ae0fa

Please sign in to comment.
Something went wrong with that request. Please try again.