mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-20 10:16:42 -06:00
Fixes #13064: Ensure unchecked checkboxes do not revert to original values upon HTMX form refresh
This commit is contained in:
parent
6093debb71
commit
a46255ddda
@ -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]
|
||||
|
6
netbox/templates/django/forms/widgets/checkbox.html
Normal file
6
netbox/templates/django/forms/widgets/checkbox.html
Normal 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" %}
|
Loading…
Reference in New Issue
Block a user