Commit 7fb868df authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

fix error 500 when runner token is invalid

parent 96e19513
......@@ -141,9 +141,12 @@ def jwt_auth(request):
return HttpResponse(status=401)
username, password = base64.b64decode(credentials).decode('utf-8').split(':', 1)
#log.debug('HTTP_AUTHORIZATION %s username %s', auth_header, username)
if username == "$token" and Runner.objects.get(token=password):
log.info("Token for runner called")
if username == "$token":
try:
actor = Runner.objects.get(token=password)
log.info("Token for runner called")
except Runner.DoesNotExist:
return HttpResponse(status=401)
else:
try:
actor = User.objects.get(email=username)
......
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