Removed unused import, PEP8 cleanups
This commit is contained in:
@@ -5,9 +5,11 @@ from django.utils.translation import ugettext
|
||||
|
||||
|
||||
# From http://www.peterbe.com/plog/whitelist-blacklist-logic
|
||||
def accept_item(value, whitelist, blacklist, default_accept=True):
|
||||
""" return true if this item is either whitelisted or
|
||||
not blacklisted """
|
||||
def accept_item(value, whitelist, blacklist, default_accept=True):
|
||||
"""
|
||||
return true if this item is either whitelisted or
|
||||
not blacklisted
|
||||
"""
|
||||
if not whitelist:
|
||||
whitelist = []
|
||||
|
||||
@@ -18,9 +20,9 @@ def accept_item(value, whitelist, blacklist, default_accept=True):
|
||||
for reject, item_list in ([False, whitelist], [True, blacklist]):
|
||||
#print 'item_list: %s' % item_list
|
||||
#print 'reject: %s' % reject
|
||||
for okpattern in item_list:
|
||||
for okpattern in item_list:
|
||||
#print 'okpattern: %s' % okpattern
|
||||
if re.findall(okpattern.replace('*','\S+'), value, re.I):
|
||||
if re.findall(okpattern.replace('*', '\S+'), value, re.I):
|
||||
# match!
|
||||
#print 'MATCH'
|
||||
if reject:
|
||||
|
||||
Reference in New Issue
Block a user