summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-22 02:48:19 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-22 02:48:19 +0000
commitb46a093c4598385b3bc7fb5803ebe7bb0677fdd4 (patch)
tree5f15c570a57c346650ce318055c2f8705208cabc /django/core
parent4f63ce5b4a625c15718c676f5efb78e0ffa282f5 (diff)
Fixed #2678 -- Moved the list of profanities for the hasNoProfanities validator
into global_settings. Patch from Matt Croydon. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3784 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core')
-rw-r--r--django/core/validators.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/django/core/validators.py b/django/core/validators.py
index 8f40ceb51a..6a8418848b 100644
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -227,9 +227,8 @@ def hasNoProfanities(field_data, all_data):
catch 'motherfucker' as well. Raises a ValidationError such as:
Watch your mouth! The words "f--k" and "s--t" are not allowed here.
"""
- bad_words = ['asshat', 'asshead', 'asshole', 'cunt', 'fuck', 'gook', 'nigger', 'shit'] # all in lower case
field_data = field_data.lower() # normalize
- words_seen = [w for w in bad_words if field_data.find(w) > -1]
+ words_seen = [w for w in settings.PROFANITIES_LIST if field_data.find(w) > -1]
if words_seen:
from django.utils.text import get_text_list
plural = len(words_seen) > 1