Use format_html instead of plain text
This commit is contained in:
parent
034509d523
commit
f69aad203e
1 changed files with 3 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from django.utils.html import format_html
|
||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,7 +77,8 @@ class ResourceAdmin(admin.ModelAdmin):
|
||||||
# )
|
# )
|
||||||
|
|
||||||
def resource_url(self, instance):
|
def resource_url(self, instance):
|
||||||
return '<a href="%s" target="_blank">%s</a>' % (str(instance.url).strip("#"), str(instance.url).strip("#"))
|
return format_html('<a href="{0}" target="_blank">{1}</a>',
|
||||||
|
str(instance.url).strip("#"), str(instance.url).strip("#"))
|
||||||
|
|
||||||
|
|
||||||
class RangeAdmin(admin.ModelAdmin):
|
class RangeAdmin(admin.ModelAdmin):
|
||||||
|
|
Loading…
Reference in a new issue