summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-08-12 03:27:57 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-08-12 03:27:57 +0000
commitf128c7bbb787be670a1a827c5bf810d0ea78ce20 (patch)
tree1d29a244a529d84e8d022d55d2ff6143ee5a0633
parent9ee6326cb6a47dcc9b4a318da38a214e2c687bae (diff)
Fixed #5011 -- Fixed usage of ungettext in hasNoProfanities validator. Thanks, tzellman@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5864 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/validators.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/validators.py b/django/core/validators.py
index fde4f052cb..717262a065 100644
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -269,7 +269,7 @@ def hasNoProfanities(field_data, all_data):
words_seen = [w for w in settings.PROFANITIES_LIST if w in field_data]
if words_seen:
from django.utils.text import get_text_list
- plural = len(words_seen) > 1
+ plural = len(words_seen)
raise 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 words_seen], 'and')