Skip to content

Commit

Permalink
Correctness: no format args format_html -> mark_safe
Browse files Browse the repository at this point in the history
  • Loading branch information
beatonma committed Feb 2, 2024
1 parent 3752faf commit 0555e13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mentions/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django import forms
from django.contrib import admin
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _

from mentions.models import (
Expand Down Expand Up @@ -218,4 +218,4 @@ class PendingOutgoingAdmin(BaseAdmin):


def clickable_link(url: str) -> str:
return format_html(f"<a href={url}>{url}</a>")
return mark_safe(f"<a href={url}>{url}</a>")
4 changes: 2 additions & 2 deletions mentions/templatetags/webmention_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@register.simple_tag
def success_icon(successful: bool) -> str:
successful_str = format_html(str(successful).lower())
successful_str = mark_safe(str(successful).lower())

if successful:
title = "Success"
Expand Down Expand Up @@ -60,7 +60,7 @@ def short_url(url: str) -> str:
# Replace own domain with 'home' icon for brevity.
return format_html("""<span class="icon">&#127968;</span>{url}""", url=url)

return format_html(url)
return mark_safe(url)


@register.simple_tag
Expand Down

0 comments on commit 0555e13

Please sign in to comment.