From f9cc65c152183cd6a24896b7fb9d07457f8617ab Mon Sep 17 00:00:00 2001 From: Mounir Date: Mon, 30 Apr 2018 14:23:18 +0200 Subject: [PATCH 1/2] Use mark_safe to use html in users list admin --- hc/accounts/admin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hc/accounts/admin.py b/hc/accounts/admin.py index 1f757214..793e49fc 100644 --- a/hc/accounts/admin.py +++ b/hc/accounts/admin.py @@ -96,6 +96,7 @@ class HcUserAdmin(UserAdmin): ordering = ["-id"] + @mark_safe def engagement(self, user): result = "" num_checks = Check.objects.filter(user=user).count() @@ -119,6 +120,7 @@ class HcUserAdmin(UserAdmin): engagement.allow_tags = True + @mark_safe def checks(self, user): url = reverse("hc-switch-team", args=[user.username]) return "Checks" % url From 0e4c66f3952dd3c307a3bdf148e8056aec723f86 Mon Sep 17 00:00:00 2001 From: Mounir Date: Mon, 30 Apr 2018 14:49:43 +0200 Subject: [PATCH 2/2] Remove allow_tag as it's not needed anymore --- hc/accounts/admin.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hc/accounts/admin.py b/hc/accounts/admin.py index 793e49fc..96e626bf 100644 --- a/hc/accounts/admin.py +++ b/hc/accounts/admin.py @@ -118,15 +118,11 @@ class HcUserAdmin(UserAdmin): return result - engagement.allow_tags = True - @mark_safe def checks(self, user): url = reverse("hc-switch-team", args=[user.username]) return "Checks" % url - checks.allow_tags = True - def send_report(self, request, qs): for user in qs: user.profile.send_report()