Skip to content

Commit

Permalink
Improve prettyprint
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Jun 25, 2023
1 parent 7a6962a commit 816e70a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/utils/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
from django.apps import apps
from django.core import serializers
from django.utils import timezone
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.html import format_html


DATE_FORMAT = "%Y-%m-%d"
Expand Down Expand Up @@ -189,6 +188,7 @@ def pretty_print_readonly_jsonfield(jsonfield_data):

if jsonfield_data:
result = json.dumps(jsonfield_data, indent=4, ensure_ascii=False)
result = mark_safe(f"<pre>{escape(result)}</pre>")
# result = mark_safe(f"<pre>{escape(result)}</pre>")
result = format_html("<pre>{}</pre>", result)

return result

0 comments on commit 816e70a

Please sign in to comment.