diff --git a/helpdesk/lib.py b/helpdesk/lib.py index 5baffaa1..7cdfb967 100644 --- a/helpdesk/lib.py +++ b/helpdesk/lib.py @@ -99,7 +99,6 @@ def text_is_spam(text, request): if hasattr(settings, 'TYPEPAD_ANTISPAM_API_KEY'): apikey = settings.TYPEPAD_ANTISPAM_API_KEY - ak.baseurl = 'api.antispam.typepad.com/1.1/' elif hasattr(settings, 'PYTHON_AKISMET_API_KEY'): # new env var expected by python-akismet package apikey = settings.PYTHON_AKISMET_API_KEY @@ -114,6 +113,9 @@ def text_is_spam(text, request): key=apikey, ) + if hasattr(settings, 'TYPEPAD_ANTISPAM_API_KEY'): + ak.baseurl = 'api.antispam.typepad.com/1.1/' + if ak.verify_key(): ak_data = { 'user_ip': request.META.get('REMOTE_ADDR', '127.0.0.1'),