summaryrefslogtreecommitdiff
path: root/app/links/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/links/models.py')
-rw-r--r--app/links/models.py7
1 files changed, 4 insertions, 3 deletions
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('<a href="%s">Visit Site</a>' % (self.url))
- admin_link.allow_tags = True
- admin_link.short_description = 'Link'
+ return format_html('<a href="%s">Visit Site</a>' % (self.url))
+ admin_link.short_description = 'Link'
+
@receiver(post_save, sender=Link)
def post_save_events(sender, update_fields, created, instance, **kwargs):