Merge pull request #135 from hodossy/master

Django 1.11 compatibility
This commit is contained in:
Corey Oordt 2017-10-12 19:45:01 -05:00 committed by GitHub
commit fc6a73d8e5
2 changed files with 2 additions and 9 deletions

View file

@ -4,7 +4,6 @@ from django.contrib.admin.views.main import ChangeList
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from django.contrib.admin.options import IncorrectLookupParameters
from django import template
from django.shortcuts import render_to_response
import django
@ -253,15 +252,11 @@ class TreeEditor(admin.ModelAdmin):
'selection_note_all': selection_note_all % {'total_count': cl.result_count},
})
context.update(extra_context or {})
context_instance = template.RequestContext(
request,
context
)
return render_to_response(self.change_list_template or [
'admin/%s/%s/change_list.html' % (app_label, opts.object_name.lower()),
'admin/%s/change_list.html' % app_label,
'admin/change_list.html'
], context=context_instance.flatten())
], context=context)
def changelist_view(self, request, extra_context=None, *args, **kwargs):
"""

View file

@ -1,6 +1,5 @@
from django.shortcuts import get_object_or_404
from django.core.exceptions import ObjectDoesNotExist
from django.template import RequestContext
from django.http import HttpResponse, Http404
from django.template.loader import select_template
from django.utils.translation import ugettext_lazy as _
@ -37,8 +36,7 @@ def category_detail(request, path, template_name='categories/category_detail.htm
path_items.pop()
templates.append(template_name)
context = RequestContext(request)
context.update({'category': category})
context = {'category': category}
if extra_context:
context.update(extra_context)
return HttpResponse(select_template(templates).render(context))