Skip to content

Commit b9e4af7

Browse files
Fix DeprecationWarnings about form default templates (#1878)
Co-authored-by: tschilling <[email protected]>
1 parent 9f66bd3 commit b9e4af7

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

debug_toolbar/templates/debug_toolbar/panels/history.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% load i18n %}{% load static %}
22
<form method="get" action="{% url 'djdt:history_refresh' %}">
3-
{{ refresh_form }}
3+
{{ refresh_form.as_div }}
44
<button class="refreshHistory">Refresh</button>
55
</form>
66
<table class="djdt-max-height-100">

debug_toolbar/templates/debug_toolbar/panels/history_tr.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</td>
4444
<td class="djdt-actions">
4545
<form method="get" action="{% url 'djdt:history_sidebar' %}">
46-
{{ store_context.form }}
46+
{{ store_context.form.as_div }}
4747
<button data-store-id="{{ id }}" class="switchHistory">Switch</button>
4848
</form>
4949
</td>

debug_toolbar/templates/debug_toolbar/panels/sql.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
{% if query.params %}
7878
{% if query.is_select %}
7979
<form method="post">
80-
{{ query.form }}
80+
{{ query.form.as_div }}
8181
<button formaction="{% url 'djdt:sql_select' %}" class="remoteCall">Sel</button>
8282
<button formaction="{% url 'djdt:sql_explain' %}" class="remoteCall">Expl</button>
8383
{% if query.vendor == 'mysql' %}

docs/changes.rst

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Pending
99
workaround for ``INTERNAL_IPS``.
1010
* Display a better error message when the toolbar's requests
1111
return invalid json.
12+
* Render forms with ``as_div`` to silence Django 5.0 deprecation warnings.
1213

1314
4.3.0 (2024-02-01)
1415
------------------

0 commit comments

Comments
 (0)