diff mbox

[09/15] views: Use context dictionaries in '__init__'

Message ID 1458841980-17014-10-git-send-email-stephen.finucane@intel.com
State Accepted
Headers show

Commit Message

Stephen Finucane March 24, 2016, 5:52 p.m. UTC
Remove the use of PatchworkRequestContext in one function of this view
as it is not required and causes a 'RemovedInDjango110Warning' warning.
This requires the use of 'render', rather than 'render_to_response'.

The remaining use of this context option will be addressed in a
follow-up patch.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
---
 patchwork/views/__init__.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/patchwork/views/__init__.py b/patchwork/views/__init__.py
index 46ff7d6..5a5c370 100644
--- a/patchwork/views/__init__.py
+++ b/patchwork/views/__init__.py
@@ -28,7 +28,7 @@  import email.utils
 import re
 
 from django.http import Http404
-from django.shortcuts import render_to_response, get_object_or_404
+from django.shortcuts import render, get_object_or_404
 
 from patchwork.forms import MultiplePatchForm
 from patchwork.models import (Bundle, BundlePatch, Comment, Patch,
@@ -388,11 +388,11 @@  def confirm(request, key):
     if conf.active and conf.is_valid():
         return views[conf.type](request, conf)
 
-    context = PatchworkRequestContext(request)
+    context = {}
     context['conf'] = conf
     if not conf.active:
         context['error'] = 'inactive'
     elif not conf.is_valid():
         context['error'] = 'expired'
 
-    return render_to_response('patchwork/confirm-error.html', context)
+    return render(request, 'patchwork/confirm-error.html', context)