From 895bb05566a82063faf59e5131ad4cd2d8aeb6d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ara=C3=BAjo?= Date: Wed, 19 Apr 2017 16:15:29 -0300 Subject: [PATCH] Using the 'render' function to ensure the execution of context processors properly --- reversion_compare/admin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reversion_compare/admin.py b/reversion_compare/admin.py index 9e89e86..c48ac1f 100644 --- a/reversion_compare/admin.py +++ b/reversion_compare/admin.py @@ -14,7 +14,6 @@ import logging -from django import template from django.conf import settings from django.conf.urls import url from django.contrib import admin @@ -27,7 +26,7 @@ except: # Django < 1.10 # pragma: no cover from django.core.urlresolvers import reverse from django.http import Http404 -from django.shortcuts import get_object_or_404, render_to_response +from django.shortcuts import get_object_or_404, render from django.utils.text import capfirst from django.utils.translation import ugettext as _ @@ -211,8 +210,8 @@ def compare_view(self, request, object_id, extra_context=None): extra_context = extra_context or {} context.update(extra_context) - return render_to_response(self.compare_template or self._get_template_list("compare.html"), - context, template.RequestContext(request)) + return render(request, self.compare_template or self._get_template_list("compare.html"), + context) class CompareVersionAdmin(CompareMethodsMixin, BaseCompareVersionAdmin):