added json to timerange failures

This commit is contained in:
2010-04-14 18:24:21 -07:00
parent 1ac0de80e0
commit 5ba91d6ae4

View File

@@ -89,6 +89,10 @@ def failswindow(request):
period=request.GET['window']
m = re.match("(\d+)([ymwdh])", period)
failures = get_fails_in_timerange(period)
if request.GET.has_key('json'):
jtext = list(failures)
return HttpResponse(json.dumps(jtext))
else:
if m.group(2) == 'd':
prd='days'
elif m.group(2) == 'h':