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