File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1212from django .template .defaultfilters import truncatechars
1313from django .urls import re_path , reverse
1414from django .utils .encoding import force_str
15- from django .utils .html import mark_safe
15+ from django .utils .html import mark_safe , conditional_escape
1616from django .utils .text import capfirst
1717from django .utils .translation import gettext as _
1818
@@ -126,10 +126,12 @@ def format_history_delta_change(self, change: ModelChange) -> dict:
126126 the object history page.
127127 """
128128 field_meta = self .model ._meta .get_field (change .field )
129+ old = conditional_escape (change .old )
130+ new = conditional_escape (change .new )
129131 return {
130132 "field" : capfirst (field_meta .verbose_name ),
131- "old" : truncatechars (change . old , self .max_displayed_history_change_chars ),
132- "new" : truncatechars (change . new , self .max_displayed_history_change_chars ),
133+ "old" : truncatechars (old , self .max_displayed_history_change_chars ),
134+ "new" : truncatechars (new , self .max_displayed_history_change_chars ),
133135 }
134136
135137 def response_change (self , request , obj ):
You can’t perform that action at this time.
0 commit comments