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

Fixes #12145: Employ HTMXSelect widget to fix inclusion of <select> field values during form regeneration

This commit is contained in:
jeremystretch
2023-04-03 12:49:26 -04:00
parent 2805633b16
commit 872b70c2b5
5 changed files with 26 additions and 24 deletions

View File

@ -12,6 +12,7 @@ from utilities.forms import (
BootstrapMixin, CommentField, ConfirmationForm, DynamicModelChoiceField, DynamicModelMultipleChoiceField,
JSONField, SlugField,
)
from utilities.forms.widgets import HTMXSelect
from virtualization.models import *
__all__ = (
@ -318,13 +319,7 @@ class VMInterfaceForm(InterfaceCommonForm, NetBoxModelForm):
'mode': '802.1Q Mode',
}
widgets = {
'mode': forms.Select(
attrs={
'hx-get': '.',
'hx-include': '#form_fields input',
'hx-target': '#form_fields',
}
),
'mode': HTMXSelect(),
}
def __init__(self, *args, **kwargs):