Use mark_safe to use html in users list admin

This commit is contained in:
Mounir 2018-04-30 14:23:18 +02:00 committed by GitHub
parent 08f6e17e91
commit f9cc65c152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 "<a href='%s'>Checks</a>" % url