Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the 'render' function to ensure the execution of context processors properly #90

Merged
merged 1 commit into from
Apr 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions reversion_compare/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 _

Expand Down Expand Up @@ -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):
Expand Down