Radiator JSON output (#329)

Json output from radiator when Accept header is application/json
This commit is contained in:
Robert Fletcher
2017-01-23 16:15:18 -05:00
committed by Mike Terzo
parent 9fe0f091f3
commit 333347d113

View File

@@ -1115,6 +1115,10 @@ def radiator(env):
stats['unchanged_percent'] = 0 stats['unchanged_percent'] = 0
stats['unreported_percent'] = 0 stats['unreported_percent'] = 0
if ('Accept' in request.headers and
request.headers["Accept"] == 'application/json'):
return jsonify(**stats)
return render_template( return render_template(
'radiator.html', 'radiator.html',
stats=stats, stats=stats,