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

Fixes #13064: Ensure unchecked checkboxes do not revert to original values upon HTMX form refresh

This commit is contained in:
Jeremy Stretch
2023-10-03 16:29:55 -04:00
parent 6093debb71
commit a46255ddda
2 changed files with 10 additions and 0 deletions

View File

@@ -355,6 +355,7 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'django.forms',
'corsheaders',
'debug_toolbar',
'graphiql_debug_toolbar',
@@ -430,6 +431,9 @@ TEMPLATES = [
},
]
# This allows us to override Django's stock form widget templates
FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
# Set up authentication backends
if type(REMOTE_AUTH_BACKEND) not in (list, tuple):
REMOTE_AUTH_BACKEND = [REMOTE_AUTH_BACKEND]

View File

@@ -0,0 +1,6 @@
{% comment %}
Include a hidden field of the same name to ensure that unchecked checkboxes
are always included in the submitted form data.
{% endcomment %}
<input type="hidden" name="{{ widget.name }}" value="">
{% include "django/forms/widgets/input.html" %}