Skip to content

Commit 88dec0f

Browse files
authored
fix: help text templates (#299)
1 parent 21031f7 commit 88dec0f

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/unfold/forms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from django.contrib.auth.forms import UserChangeForm as BaseUserChangeForm
1414
from django.contrib.auth.forms import UserCreationForm as BaseUserCreationForm
1515
from django.http import HttpRequest
16+
from django.utils.safestring import mark_safe
1617
from django.utils.translation import gettext_lazy as _
1718

1819
from .widgets import BASE_INPUT_CLASSES, INPUT_CLASSES, SELECT_CLASSES
@@ -75,7 +76,7 @@ def __init__(
7576

7677
password = self.fields.get("password")
7778
if password:
78-
password.help_text = password.help_text.format("../password/")
79+
password.help_text = mark_safe(password.help_text.format("../password/"))
7980

8081

8182
class AdminPasswordChangeForm(BaseAdminPasswordChangeForm):

src/unfold/templates/admin/includes/fieldset.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
4141
{% endif %}
4242

4343
{% if field.field.help_text %}
44-
<div class="leading-relaxed mt-2 text-gray-500 text-xs dark:text-gray-400">
45-
{{ field.field.help_text|safe }}
46-
</div>
44+
{% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
4745
{% endif %}
4846
</div>
4947
{% endfor %}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% if help_text %}
22
<div class="leading-relaxed mt-2 text-gray-500 text-xs dark:text-gray-400">
3-
{{ help_text|safe }}
3+
{{ help_text }}
44
</div>
55
{% endif %}

0 commit comments

Comments
 (0)