Code

Ticket #6116: admin_list__result_headers__mark_safe.diff

File admin_list__result_headers__mark_safe.diff, 731 bytes (added by zlobnyi antisvin <antisvin@…>, 7 years ago)

Add mark_safe function call

Line 
1Index: django/contrib/admin/templatetags/admin_list.py
2===================================================================
3--- django/contrib/admin/templatetags/admin_list.py     (revision 6865)
4+++ django/contrib/admin/templatetags/admin_list.py     (working copy)
5@@ -114,7 +114,7 @@
6         yield {"text": header,
7                "sortable": True,
8                "url": cl.get_query_string({ORDER_VAR: i, ORDER_TYPE_VAR: new_order_type}),
9-               "class_attrib": (th_classes and ' class="%s"' % ' '.join(th_classes) or '')}
10+               "class_attrib": mark_safe(th_classes and ' class="%s"' % ' '.join(th_classes) or '')}
11 
12 def _boolean_icon(field_val):
13     BOOLEAN_MAPPING = {True: 'yes', False: 'no', None: 'unknown'}