Correct longstanding issues with the EVEAccount object regarding its primary key

This commit is contained in:
2011-05-19 16:00:27 +01:00
parent 1533d937f4
commit d1afc15fc0
8 changed files with 177 additions and 15 deletions

View File

@@ -126,7 +126,7 @@ class OpTimerHandler(BaseHandler):
allowed_methods = ('GET')
def read(self, request, id=None):
obj = get_object_or_404(EVEAccount, id=FULL_API_USER_ID)
obj = get_object_or_404(EVEAccount, pk=FULL_API_USER_ID)
params = {'userID': obj.id, 'apiKey': obj.api_key, 'characterID': FULL_API_CHARACTER_ID}

View File

@@ -70,7 +70,7 @@ class V2EveAPIProxyHandler(BaseHandler):
try:
userid = request.GET.get('userid', None)
obj = EVEAccount.objects.get(api_user_id=userid)
obj = EVEAccount.objects.get(pk=userid)
params['apikey'] = obj.api_key
except EVEAccount.DoesNotExist:
pass