Skip to content

Commit

Permalink
code updates to AkismetWithoutStartupVerify
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie01 committed Apr 24, 2024
1 parent e83afa8 commit 0628922
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Allura/allura/lib/spam/akismetfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@


if AKISMET_AVAILABLE:
class AkismetWithoutStartupVerify(akismet.Akismet):
class AkismetWithoutStartupVerify(akismet.SyncClient):
def __init__(self, key=None, blog_url=None):
# avoid possible errors at instantiation time, will encounter them later
self.api_key = key
self.blog_url = blog_url
self._config = akismet.Config(key=key, url=blog_url)
akismet_client = akismet.SyncClient(config=self._config)
self._http_client = akismet_client._http_client
if not akismet_client.verify_key(self._config.key, self._config.url):
raise Exception('Akismet key verification failed')


class AkismetSpamFilter(SpamFilter):
Expand Down

0 comments on commit 0628922

Please sign in to comment.