1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Clean up usages of mark_safe()

This commit is contained in:
jeremystretch
2022-08-08 10:47:07 -04:00
parent 135543683d
commit 90317adae7
4 changed files with 8 additions and 11 deletions

View File

@@ -86,8 +86,8 @@ def placeholder(value):
"""
if value not in ('', None):
return value
placeholder = '<span class="text-muted">&mdash;</span>'
return mark_safe(placeholder)
return mark_safe('<span class="text-muted">&mdash;</span>')
@register.filter()

View File

@@ -109,9 +109,7 @@ def annotated_date(date_value):
long_ts = date(date_value, 'DATETIME_FORMAT')
short_ts = date(date_value, 'SHORT_DATETIME_FORMAT')
span = f'<span title="{long_ts}">{short_ts}</span>'
return mark_safe(span)
return mark_safe(f'<span title="{long_ts}">{short_ts}</span>')
@register.simple_tag