small bug in the admin panel fixed

This commit is contained in:
phear 2013-02-23 13:00:19 +00:00
parent 88a7725d0f
commit 215495915c

View file

@ -581,7 +581,7 @@ def is_spam_submitter_name(name, errors_dict):
else:
return False
def count_urls(text, errors_dict):
def count_urls(text):
hits = re.findall(r"(\swww\.|http://|https://)", text)
return len(hits)
@ -1210,11 +1210,12 @@ def admin_maintenance(age_days=60, keyword="viagra", keyword_submission="viagra"
for poll in Poll.select():
if (keyword in poll.title.lower()) or (keyword in poll.description.lower()):
poll.destroySelf()
elif method == "Remove submission by keyword" and keyword:
elif method == "Remove submission by keyword" and keyword_submission:
keyword = keyword_submission.lower()
for submission in ContentSubmission.select():
if keyword in submission.content.lower():
submission.destroySelf()
return bobo.redirect("../admin")
@bobo.query('/admin')