Fix stdout plaintext render

* Was rendering as json (though text/plain)
* Switched to rendering it as normal text with stripped ansi
* Fixes: https://trello.com/c/TMyOak0H/142-api-v1-jobs-n-stdout-format-txt-emits-json-output
This commit is contained in:
Matthew Jones 2015-08-21 10:20:57 -04:00
parent a76b1a0432
commit c5ce9cdc12

View File

@ -2838,6 +2838,8 @@ class UnifiedJobStdout(RetrieveAPIView):
return response
except Exception, e:
return Response({"error": "Error generating stdout download file: %s" % str(e)}, status=status.HTTP_400_BAD_REQUEST)
elif request.accepted_renderer.format == 'txt':
return Response(unified_job.result_stdout)
else:
return super(UnifiedJobStdout, self).retrieve(request, *args, **kwargs)