From 816e70a7c81f960152836c5c296084cccf3a9b5f Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Mon, 26 Jun 2023 01:55:11 +0200 Subject: [PATCH] Improve prettyprint --- core/utils/utilities.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/utils/utilities.py b/core/utils/utilities.py index 2d43fad2..1b4ce23e 100644 --- a/core/utils/utilities.py +++ b/core/utils/utilities.py @@ -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" @@ -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"
{escape(result)}
") + # result = mark_safe(f"
{escape(result)}
") + result = format_html("
{}
", result) return result