Skip to content

Commit

Permalink
Merge pull request #113 from advisory/develop
Browse files Browse the repository at this point in the history
Fix render_to_response for Django 1.10
  • Loading branch information
saxix committed Mar 15, 2017
2 parents d6640b3 + 08ec19b commit 3b7cbeb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/adminactions/byrows_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

from django.forms.models import modelformset_factory

if django.VERSION[:2] > (1, 8):
from django.shortcuts import render

def render_to_response(template_name, context): # noqa
return render(context.request, template_name, context=context.flatten())


def byrows_update(modeladmin, request, queryset): # noqa
"""
Expand Down
6 changes: 6 additions & 0 deletions src/adminactions/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
from .models import get_permission_codename
from .signals import adminaction_end, adminaction_requested, adminaction_start

if django.VERSION[:2] > (1, 8):
from django.shortcuts import render

def render_to_response(template_name, context): # noqa
return render(context.request, template_name, context=context.flatten())


def get_action(request):
try:
Expand Down
6 changes: 6 additions & 0 deletions src/adminactions/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
from .models import get_permission_codename
from .signals import adminaction_end, adminaction_requested, adminaction_start

if django.VERSION[:2] > (1, 8):
from django.shortcuts import render

def render_to_response(template_name, context): # noqa
return render(context.request, template_name, context=context.flatten())


def graph_form_factory(model):
app_name = model._meta.app_label
Expand Down
2 changes: 1 addition & 1 deletion tests/test_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class ExportMixin(object):
fixtures = ['adminactions', 'demoproject']
urls = 'demo.urls'
csrf_checks = False
csrf_checks = True

def setUp(self):
super(ExportMixin, self).setUp()
Expand Down

0 comments on commit 3b7cbeb

Please sign in to comment.