summaryrefslogtreecommitdiffstats
path: root/news
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-09-03 20:44:27 +0200
committerDan McGee <dan@archlinux.org>2010-09-03 20:45:13 +0200
commit872af225a98b9c328988e1cdbdea2ca73b8d185c (patch)
tree2d0e486f2321f5113f3e0b9e6c7625c2d76d64de /news
parent7c7f57f6ac43af5350f04c6eaeb927063ad4daee (diff)
downloadarchweb-872af225a98b9c328988e1cdbdea2ca73b8d185c.tar.gz
archweb-872af225a98b9c328988e1cdbdea2ca73b8d185c.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'news')
-rw-r--r--news/views.py7
1 files changed, 3 insertions, 4 deletions
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