diff options
| author | Jannis Leidel <jannis@leidel.info> | 2011-07-04 16:20:10 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2011-07-04 16:20:10 +0000 |
| commit | c6ae0fa549a250fb862436587c88ae6ad81da90c (patch) | |
| tree | 07fb45a5e0c8dbbbc71408e89f553f1c70788f3e | |
| parent | 7db68a888b633f2b65f753d50f21463b65a01edf (diff) | |
Fixed #16403 -- Correctly use ungettext in comments form. Thanks, poirier.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16505 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/comments/forms.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/django/contrib/comments/forms.py b/django/contrib/comments/forms.py index d497572488..bdeac99315 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): |
