Skip to content

Commit

Permalink
Fixed test runs in Django 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
vdboor committed Apr 27, 2017
1 parent 357d4ae commit 52e80a3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fluent_contents/admin/placeholdereditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def _get_contentitem_formset_html(self, request, obj, FormSet, inline, placehold
}
if django.VERSION >= (1, 8):
context = RequestContext(request, context)
form_html = render_to_string(template_name, context)
form_html = render_to_string(template_name, context.flatten())
else:
form_html = render_to_string(template_name, context, context_instance=RequestContext(request))

Expand Down
3 changes: 1 addition & 2 deletions fluent_contents/forms/widgets.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from future.builtins import int
from django.contrib.admin.widgets import AdminTextareaWidget
from django.forms.widgets import Widget
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.forms.widgets import flatatt
from django.forms.utils import flatatt
from django.utils.html import escape
from fluent_contents.models import get_parent_language_code
from fluent_contents.models.managers import get_parent_active_language_choices
Expand Down
2 changes: 1 addition & 1 deletion fluent_contents/rendering/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def merge_output(self, result, items, template_name):
if django.VERSION >= (1, 8):
# Avoid RemovedInDjango110Warning
context = PluginContext(self.request, context)
merged_html = render_to_string(template_name, context)
merged_html = render_to_string(template_name, context.flatten())
else:
merged_html = render_to_string(template_name, context, context_instance=PluginContext(self.request))

Expand Down

0 comments on commit 52e80a3

Please sign in to comment.