]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
views: Use context dictionaries in '__init__'
authorStephen Finucane <stephen.finucane@intel.com>
Mon, 21 Mar 2016 17:37:42 +0000 (17:37 +0000)
committerStephen Finucane <stephen.finucane@intel.com>
Fri, 25 Mar 2016 11:25:00 +0000 (11:25 +0000)
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>
Tested-by: Andy Doan <andy.doan@linaro.org>
patchwork/views/__init__.py

index 46ff7d6105bb0c37396b2e7439c69f89c0b7f715..5a5c370855a313be74025b1a8b49259cca621c59 100644 (file)
@@ -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)