forked from extern/django-helpdesk
fixing those two python files
This commit is contained in:
parent
179ceb2f82
commit
f017adea63
@ -31,7 +31,7 @@ The default is : ::
|
|||||||
Whatever you pass in, will replace the *Python Interface by Fuzzyman* part.
|
Whatever you pass in, will replace the *Python Interface by Fuzzyman* part.
|
||||||
**0.2.0** will change with the version of this interface.
|
**0.2.0** will change with the version of this interface.
|
||||||
|
|
||||||
Usage example::
|
Usage example:
|
||||||
|
|
||||||
from akismet import Akismet
|
from akismet import Akismet
|
||||||
|
|
||||||
@ -203,13 +203,13 @@ class Akismet(object):
|
|||||||
worked out.
|
worked out.
|
||||||
"""
|
"""
|
||||||
data['comment_content'] = comment
|
data['comment_content'] = comment
|
||||||
if not 'user_ip' in data:
|
if 'user_ip' not in data:
|
||||||
try:
|
try:
|
||||||
val = os.environ['REMOTE_ADDR']
|
val = os.environ['REMOTE_ADDR']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise AkismetError("No 'user_ip' supplied")
|
raise AkismetError("No 'user_ip' supplied")
|
||||||
data['user_ip'] = val
|
data['user_ip'] = val
|
||||||
if not 'user_agent' in data:
|
if 'user_agent' not in data:
|
||||||
try:
|
try:
|
||||||
val = os.environ['HTTP_USER_AGENT']
|
val = os.environ['HTTP_USER_AGENT']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
@ -109,6 +109,7 @@ def api_return(status, text='', json=False):
|
|||||||
|
|
||||||
|
|
||||||
class API:
|
class API:
|
||||||
|
|
||||||
def __init__(self, request):
|
def __init__(self, request):
|
||||||
self.request = request
|
self.request = request
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user