Fix data source type choices during bulk edit

This commit is contained in:
Jeremy Stretch 2023-10-23 16:06:15 -04:00
parent ec098da4b9
commit 9902e2c36d
2 changed files with 5 additions and 4 deletions

View File

@ -15,10 +15,8 @@ __all__ = (
class DataSourceBulkEditForm(NetBoxModelBulkEditForm):
type = forms.ChoiceField(
label=_('Type'),
# TODO: Field value should be empty on init (needs add_blank_choice())
choices=get_data_backend_choices,
required=False,
initial=''
required=False
)
enabled = forms.NullBooleanField(
required=False,

View File

@ -8,7 +8,10 @@ __all__ = (
def get_data_backend_choices():
return [
(name, cls.label) for name, cls in registry['data_backends'].items()
(None, '---------'),
*[
(name, cls.label) for name, cls in registry['data_backends'].items()
]
]