diff options
author | luxagraf <sng@luxagraf.net> | 2018-01-31 12:11:07 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-01-31 12:11:07 -0600 |
commit | 193380f53799e2fa5f15817caec47ccf914359e6 (patch) | |
tree | 607e8792b9819e3281ef7dcc8a3f3c32c1c34172 /app/links/models.py | |
parent | 18668343120be2ccf80a3b05920cce7881501dfa (diff) |
fixed some admin bugs on live server
Diffstat (limited to 'app/links/models.py')
-rw-r--r-- | app/links/models.py | 7 |
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): |