Skip to content

Commit 0628922

Browse files
committed
code updates to AkismetWithoutStartupVerify
1 parent e83afa8 commit 0628922

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Allura/allura/lib/spam/akismetfilter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,16 @@
3535

3636

3737
if AKISMET_AVAILABLE:
38-
class AkismetWithoutStartupVerify(akismet.Akismet):
38+
class AkismetWithoutStartupVerify(akismet.SyncClient):
3939
def __init__(self, key=None, blog_url=None):
4040
# avoid possible errors at instantiation time, will encounter them later
4141
self.api_key = key
4242
self.blog_url = blog_url
43+
self._config = akismet.Config(key=key, url=blog_url)
44+
akismet_client = akismet.SyncClient(config=self._config)
45+
self._http_client = akismet_client._http_client
46+
if not akismet_client.verify_key(self._config.key, self._config.url):
47+
raise Exception('Akismet key verification failed')
4348

4449

4550
class AkismetSpamFilter(SpamFilter):

0 commit comments

Comments
 (0)