Code

Ticket #5011: validators_patch.txt

File validators_patch.txt, 679 bytes (added by tzellman@…, 7 years ago)

1-line diff

Line 
1Index: validators.py
2===================================================================
3--- validators.py       (revision 5753)
4+++ validators.py       (working copy)
5@@ -269,7 +269,7 @@
6     words_seen = [w for w in settings.PROFANITIES_LIST if w in field_data]
7     if words_seen:
8         from django.utils.text import get_text_list
9-        plural = len(words_seen) > 1
10+        plural = len(words_seen)
11         raise ValidationError, ungettext("Watch your mouth! The word %s is not allowed here.",
12             "Watch your mouth! The words %s are not allowed here.", plural) % \
13             get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in words_seen], 'and')