X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/08dbd720394d897a295fd610d30990b9fad26a04..19a817e69c4518215a96e0456bbea06aa4e03e63:/forum/models/node.py?ds=sidebyside diff --git a/forum/models/node.py b/forum/models/node.py index dc292fb..19973e9 100644 --- a/forum/models/node.py +++ b/forum/models/node.py @@ -257,18 +257,11 @@ class Node(BaseModel, NodeContent): @staticmethod def isSpam(comment, data): - #api = Akismet() - - #if not api.key: - # return False - #else: - # if api.comment_check(comment, data): - # return True - # else: - # return False - # return data - return False - + if not settings.WORDPRESS_API_KEY: + return False + + api = Akismet(settings.WORDPRESS_API_KEY, settings.APP_URL) + return api.comment_check(comment, data) class Meta: app_label = 'forum'