fixing those two python files

This commit is contained in:
Alex Barcelo 2016-10-24 10:05:41 +02:00
parent 179ceb2f82
commit f017adea63
2 changed files with 47 additions and 46 deletions

View File

@ -31,7 +31,7 @@ The default is : ::
Whatever you pass in, will replace the *Python Interface by Fuzzyman* part.
**0.2.0** will change with the version of this interface.
Usage example::
Usage example:
from akismet import Akismet
@ -203,13 +203,13 @@ class Akismet(object):
worked out.
"""
data['comment_content'] = comment
if not 'user_ip' in data:
if 'user_ip' not in data:
try:
val = os.environ['REMOTE_ADDR']
except KeyError:
raise AkismetError("No 'user_ip' supplied")
data['user_ip'] = val
if not 'user_agent' in data:
if 'user_agent' not in data:
try:
val = os.environ['HTTP_USER_AGENT']
except KeyError:

View File

@ -109,6 +109,7 @@ def api_return(status, text='', json=False):
class API:
def __init__(self, request):
self.request = request