forked from extern/django-helpdesk
bug fix ak.baseurl set before ak initialized
This commit is contained in:
parent
16c70d38cd
commit
628b734451
@ -99,7 +99,6 @@ def text_is_spam(text, request):
|
|||||||
|
|
||||||
if hasattr(settings, 'TYPEPAD_ANTISPAM_API_KEY'):
|
if hasattr(settings, 'TYPEPAD_ANTISPAM_API_KEY'):
|
||||||
apikey = 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'):
|
elif hasattr(settings, 'PYTHON_AKISMET_API_KEY'):
|
||||||
# new env var expected by python-akismet package
|
# new env var expected by python-akismet package
|
||||||
apikey = settings.PYTHON_AKISMET_API_KEY
|
apikey = settings.PYTHON_AKISMET_API_KEY
|
||||||
@ -114,6 +113,9 @@ def text_is_spam(text, request):
|
|||||||
key=apikey,
|
key=apikey,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if hasattr(settings, 'TYPEPAD_ANTISPAM_API_KEY'):
|
||||||
|
ak.baseurl = 'api.antispam.typepad.com/1.1/'
|
||||||
|
|
||||||
if ak.verify_key():
|
if ak.verify_key():
|
||||||
ak_data = {
|
ak_data = {
|
||||||
'user_ip': request.META.get('REMOTE_ADDR', '127.0.0.1'),
|
'user_ip': request.META.get('REMOTE_ADDR', '127.0.0.1'),
|
||||||
|
Loading…
Reference in New Issue
Block a user