From 872af225a98b9c328988e1cdbdea2ca73b8d185c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 3 Sep 2010 13:44:27 -0500 Subject: Use direct_to_template in all remaining possible places Rather than the need to include RequestContext() calls directly, we can just use direct_to_template to do all the work for us. Signed-off-by: Dan McGee --- news/views.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'news') diff --git a/news/views.py b/news/views.py index 887fe1d..3977393 100644 --- a/news/views.py +++ b/news/views.py @@ -1,10 +1,10 @@ from django import forms from django.contrib.auth.decorators import permission_required from django.http import HttpResponse -from django.shortcuts import render_to_response, redirect -from django.template import RequestContext +from django.shortcuts import redirect from django.views.decorators.cache import never_cache from django.views.generic import list_detail, create_update +from django.views.generic.simple import direct_to_template import markdown @@ -39,8 +39,7 @@ def add(request): return redirect(newsitem.get_absolute_url()) else: form = NewsForm() - return render_to_response('news/add.html', - RequestContext(request, { 'form': form })) + return direct_to_template(request, 'news/add.html', { 'form': form }) @permission_required('main.delete_news') @never_cache -- cgit v1.2.3-24-g4f1b