diff --git a/beat/web/statistics/views.py b/beat/web/statistics/views.py index 616fdcb5ed419e2b3b84e490b07c3ef0fded9c90..f35426c98e89f4bce02b135980109020c10e80b2 100644 --- a/beat/web/statistics/views.py +++ b/beat/web/statistics/views.py @@ -31,14 +31,14 @@ import itertools import simplejson -from django.shortcuts import render_to_response -from django.template import RequestContext +from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.http import HttpResponseForbidden from django.db.models import Sum from .models import HourlyStatistics + def calculate_totals(): """Caculates all totals required by the statistics display""" @@ -269,11 +269,11 @@ def statistics(request): if not(request.user.is_superuser): return HttpResponseForbidden() - return render_to_response('statistics/statistics.html', - dict( - totals=calculate_totals(), - hourly_chart_data=hourly_charts(), - daily_chart_data=daily_charts(), - weekly_chart_data=weekly_charts(), - ), - context_instance=RequestContext(request)) + return render(request, + 'statistics/statistics.html', + dict( + totals=calculate_totals(), + hourly_chart_data=hourly_charts(), + daily_chart_data=daily_charts(), + weekly_chart_data=weekly_charts(), + ))