if agent is None:
agent = DEFAULTAGENT % __version__
self.user_agent = user_agent % (agent, __version__)
- self.key = str(settings.WORDPRESS_API_KEY)
- self.blog_url = str(settings.WORDPRESS_BLOG_URL)
+ self.setAPIKey(key, blog_url)
def _getURL(self):
\r
@staticmethod\r
def isSpam(comment, data):\r
- #api = Akismet()\r
-\r
- #if not api.key:\r
- # return False\r
- #else:\r
- # if api.comment_check(comment, data):\r
- # return True\r
- # else:\r
- # return False\r
- # return data\r
- return False\r
-\r
+ if not settings.WORDPRESS_API_KEY:\r
+ return False\r
+ \r
+ api = Akismet(settings.WORDPRESS_API_KEY, settings.APP_URL)\r
+ return api.comment_check(comment, data)\r
\r
class Meta:\r
app_label = 'forum'\r
help_text = _("Your Google analytics key. You can get one at the <a href='http://www.google.com/analytics/'>Google analytics official website</a>"),\r
required=False))\r
\r
-#WORDPRESS_API_KEY = Setting('WORDPRESS_API_KEY', '', EXT_KEYS_SET, dict(\r
-#label = _("Wordpress API key"),\r
-#help_text = _("Your Wordpress API key. You can get one at <a href='http://wordpress.com/'>http://wordpress.com/</a>"),\r
-#required=False))\r
-\r
-#WORDPRESS_BLOG_URL = Setting('WORDPRESS_BLOG_URL', '', EXT_KEYS_SET, dict(\r
-#label = _("Wordpress blog url"),\r
-#help_text = _("Your Wordpress blog url. You can get one at <a href='http://wordpress.com/'>http://wordpress.com/</a>"),\r
-#required=False))\r
-\r
-\r
-\r
-\r
+WORDPRESS_API_KEY = Setting('WORDPRESS_API_KEY', '', EXT_KEYS_SET, dict(\r
+label = _("Wordpress API key"),\r
+help_text = _("Your Wordpress API key. You can get one at <a href='http://wordpress.com/'>http://wordpress.com/</a>"),\r
+required=False))\r