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 --- devel/views.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'devel') diff --git a/devel/views.py b/devel/views.py index baa5fd6c..1f43b872 100644 --- a/devel/views.py +++ b/devel/views.py @@ -3,10 +3,9 @@ from django.http import HttpResponseRedirect from django.contrib.auth.decorators import login_required, user_passes_test from django.contrib.auth.models import User from django.contrib.sites.models import Site -from django.shortcuts import render_to_response -from django.template import RequestContext from django.core.mail import send_mail from django.views.decorators.cache import never_cache +from django.views.generic.simple import direct_to_template from main.models import Package, Todolist, TodolistPkg from main.models import Arch, Repo @@ -41,8 +40,7 @@ def index(request): 'todopkgs' : todopkgs, } - return render_to_response('devel/index.html', - RequestContext(request, page_dict)) + return direct_to_template(request, 'devel/index.html', page_dict) @login_required def change_notify(request): @@ -78,14 +76,13 @@ def change_profile(request): return HttpResponseRedirect('/devel/') else: form = ProfileForm(initial={'email': request.user.email}) - return render_to_response('devel/profile.html', - RequestContext(request, {'form': form})) + return direct_to_template(request, 'devel/profile.html', {'form': form}) @login_required def mirrorlist(request): mirrors = Mirror.objects.select_related().order_by('tier', 'country') - return render_to_response('devel/mirrorlist.html', - RequestContext(request, {'mirror_list': mirrors})) + return direct_to_template(request, 'devel/mirrorlist.html', + {'mirror_list': mirrors}) class NewUserForm(forms.ModelForm): class Meta: @@ -140,7 +137,6 @@ def new_user_form(request): 'title': 'Create User', 'submit_text': 'Create User' } - return render_to_response('general_form.html', - RequestContext(request, context)) + return direct_to_template(request, 'general_form.html', context) # vim: set ts=4 sw=4 et: -- cgit v1.2.3-2-g168b