Fixed API argument issues

This commit is contained in:
2010-07-01 10:26:23 +01:00
parent 5aa65e6a64
commit 794d074d4b
2 changed files with 8 additions and 5 deletions

View File

@@ -6,10 +6,13 @@ class APIKeyAuthentication(object):
def is_authenticated(self, request):
apikey = request.GET.get('apikey', None)
if apikey:
params = {}
for key,value in request.GET.items():
params[key.lower()] = value
if params['apikey']:
try:
keyobj = AuthAPIKey.objects.get(key=apikey)
keyobj = AuthAPIKey.objects.get(key=params['apikey'])
except:
keyobj = None

View File

@@ -107,8 +107,8 @@ class EveAPIProxyHandler(BaseHandler):
for key,value in request.GET.items():
params[key.lower()] = value
if request.GET.get('userid', None):
obj = get_object_or_404(EVEAccount, pk=request.GET.get('userid', None))
if 'userid' in params:
obj = get_object_or_404(EVEAccount, pk=params['userid'])
params['apikey'] = obj.api_key
print params