Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

Commit

Permalink
Let's try to work around akismet.py's lack of Unicode handling
Browse files Browse the repository at this point in the history
git-svn-id: http://django-comment-utils.googlecode.com/svn/trunk@77 71c79c79-8932-0410-8db2-b50025d4c983
  • Loading branch information
ubernostrum committed Sep 3, 2007
1 parent 3138580 commit aae2c99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion comment_utils/moderation.py
Expand Up @@ -232,14 +232,15 @@ def moderate(self, comment, content_object):
return True
if self.akismet:
from akismet import Akismet
from django.utils.encoding import smart_str
akismet_api = Akismet(key=settings.AKISMET_API_KEY,
blog_url='http://%s/' % Site.objects.get_current().domain)
if akismet_api.verify_key():
akismet_data = { 'comment_type': 'comment',
'referrer': '',
'user_ip': comment.ip_address,
'user_agent': '' }
if akismet_api.comment_check(comment.comment, data=akismet_data, build_data=True):
if akismet_api.comment_check(smart_str(comment.comment), data=akismet_data, build_data=False):
return True
return False

Expand Down

0 comments on commit aae2c99

Please sign in to comment.