Skip to content

Commit 20ee3f7

Browse files
authored
Merge pull request jrief#183 from hiaselhans/patch-1
use mark_safe for reorder div
2 parents 7fddeef + 8d28e00 commit 20ee3f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adminsortable2/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from django import forms
1010
from django.utils.translation import ugettext_lazy as _
11+
from django.utils.safestring import mark_safe
1112
from django.conf.urls import url
1213
from django.core.exceptions import ImproperlyConfigured
1314
from django.core.paginator import EmptyPage
@@ -165,7 +166,7 @@ def func(this, item):
165166
html = ''
166167
if this.enable_sorting:
167168
html = '<div class="drag js-reorder-{1}" order="{0}">&nbsp;</div>'.format(getattr(item, this.default_order_field), item.pk)
168-
return html
169+
return mark_safe(html)
169170

170171
setattr(func, 'allow_tags', True)
171172
# if the field used for ordering has a verbose name use it, otherwise default to "Sort"

0 commit comments

Comments
 (0)