Skip to content

Commit

Permalink
Fix copy button in Django 1.10, fix DeprecationWarning in 1.8+
Browse files Browse the repository at this point in the history
  • Loading branch information
vdboor committed Dec 15, 2016
1 parent 4d5214e commit 15b7668
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fluent_contents/admin/placeholdereditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,20 @@ def _get_contentitem_formset_html(self, request, obj, FormSet, inline, placehold

# exactly what admin/fluent_contents/contentitem/inline_container.html does:
template_name = inline_admin_formset.opts.cp_admin_form_template
form_html = render_to_string(template_name, {
context = {
'inline_admin_form': inline_admin_form,
'inline_admin_formset': inline_admin_formset,
'original': obj,
'object_id': obj.pk,
'add': False,
'change': True,
'has_change_permission': True,
}, context_instance=RequestContext(request))
}
if django.VERSION >= (1, 8):
context = RequestContext(request, context)
form_html = render_to_string(template_name, context)
else:
form_html = render_to_string(template_name, context, context_instance=RequestContext(request))

# Append to list with metadata included
contentitem = inline_admin_form.original
Expand Down

0 comments on commit 15b7668

Please sign in to comment.