Author: adrian
Date: 2007-08-11 22:27:57 -0500 (Sat, 11 Aug 2007)
New Revision: 5864
Modified:
django/trunk/django/core/validators.py
Log:
Fixed #5011 -- Fixed usage of ungettext in hasNoProfanities validator. Thanks,
[EMAIL PROTECTED]
Modified: django/trunk/django/core/validators.py
===================================================================
--- django/trunk/django/core/validators.py 2007-08-12 03:26:35 UTC (rev
5863)
+++ django/trunk/django/core/validators.py 2007-08-12 03:27:57 UTC (rev
5864)
@@ -269,7 +269,7 @@
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')
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---