Commit b2404c1d authored by Daniel Albert's avatar Daniel Albert

Fix API properly

parent 08e7c87e
......@@ -17,9 +17,9 @@ class bot_api(object):
key = request.META.get('HTTP_AUTHORIZATION', None) or request.GET.get('token', None) or None
if key is not None:
request.user = ApiKey.objects.get(key=key)
request.user = ApiKey.objects.get(key=key).user
if request.user and (not isinstance(request.user, ApiKey) or not request.user.is_anonymous):
if request.user and not request.user.is_anonymous:
return self.f(request, *args, **kwargs)
raise ApiKey.DoesNotExist
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment