From f6c55ed2bef8c419078bab3b0e7fc1ff6d5e0756 Mon Sep 17 00:00:00 2001
From: The Quokka <50312294+quokka-caredx@users.noreply.github.com>
Date: Wed, 7 Aug 2019 16:45:55 +0800
Subject: [PATCH] Added mark_safe to admin_links
Prevents html from being escaped and not displayed as links
---
forms_builder/forms/models.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/forms_builder/forms/models.py b/forms_builder/forms/models.py
index 73c6ae3b..ff3d2b7e 100644
--- a/forms_builder/forms/models.py
+++ b/forms_builder/forms/models.py
@@ -1,4 +1,5 @@
from __future__ import unicode_literals
+from django.utils.safestring import mark_safe
from django import VERSION as DJANGO_VERSION
from django.contrib.sites.models import Site
@@ -151,7 +152,7 @@ def admin_links(self):
]
for i, (text, url) in enumerate(links):
links[i] = "%s" % (url, ugettext(text))
- return "
".join(links)
+ return mark_safe("
".join(links))
admin_links.allow_tags = True
admin_links.short_description = ""