From 193380f53799e2fa5f15817caec47ccf914359e6 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 31 Jan 2018 12:11:07 -0600 Subject: fixed some admin bugs on live server --- app/links/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/links') diff --git a/app/links/models.py b/app/links/models.py index fe91b1c..4954a29 100644 --- a/app/links/models.py +++ b/app/links/models.py @@ -3,6 +3,7 @@ import json from django.template.defaultfilters import striptags from django.urls import reverse from django.utils.encoding import force_text +from django.utils.html import format_html from django.db import models from django.utils import timezone from django.core.mail import EmailMessage @@ -65,9 +66,9 @@ class Link(models.Model): return self.get_next_by_pub_date(status__exact=1) def admin_link(self): - return force_text('Visit Site' % (self.url)) - admin_link.allow_tags = True - admin_link.short_description = 'Link' + return format_html('Visit Site' % (self.url)) + admin_link.short_description = 'Link' + @receiver(post_save, sender=Link) def post_save_events(sender, update_fields, created, instance, **kwargs): -- cgit v1.2.3-70-g09d2