Use a saner setting for toggling Akismet.
This commit is contained in:
parent
d372328a16
commit
8e82a41f33
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ logger = logging.getLogger(__name__)
|
|||
akismet_api = None
|
||||
try:
|
||||
from akismet import Akismet
|
||||
if getattr(settings, 'ENVIRONMENT', 'production') != 'development':
|
||||
if getattr(settings, 'AKISMET_ENABLED', True):
|
||||
akismet_api = Akismet(key=forum_settings.AKISMET_API_KEY, blog_url=forum_settings.AKISMET_BLOG_URL, agent=forum_settings.AKISMET_AGENT)
|
||||
if not akismet_api.verify_key():
|
||||
logger.error("Invalid Aksimet API key.", extra={'key': akismet_api.key, 'blog': akismet_api.blog_url, 'user_agent': akismet_api.user_agent})
|
||||
|
|
Reference in a new issue