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