Skip to content

Commit 55c77b8

Browse files
authored
Merge pull request #228 from netbox-community/bug/227
Fixes #227 - Add blank choice on Session Bulk Edit
2 parents 7647ecf + f05bb0f commit 55c77b8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

netbox_bgp/forms.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@
2020
CSVChoiceField,
2121
CommentField,
2222
)
23+
from utilities.forms import add_blank_choice
2324
from utilities.forms.widgets import APISelect, APISelectMultiple
2425
from netbox.forms import (
2526
NetBoxModelForm,
2627
NetBoxModelBulkEditForm,
2728
NetBoxModelFilterSetForm,
2829
NetBoxModelImportForm,
2930
)
31+
from .choices import SessionStatusChoices
3032

3133
from .models import (
3234
Community,
@@ -206,6 +208,7 @@ class BGPSessionForm(NetBoxModelForm):
206208
)
207209
comments = CommentField()
208210

211+
209212
fieldsets = (
210213
FieldSet(
211214
"name",
@@ -424,10 +427,11 @@ class BGPSessionBulkEditForm(NetBoxModelBulkEditForm):
424427
site = DynamicModelChoiceField(
425428
label=_("Site"), queryset=Site.objects.all(), required=False
426429
)
430+
427431
status = forms.ChoiceField(
428-
label=_("Status"),
429-
required=False,
430-
choices=SessionStatusChoices,
432+
label=_('Status'),
433+
choices=add_blank_choice(SessionStatusChoices),
434+
required=False
431435
)
432436
description = forms.CharField(
433437
label=_("Description"), max_length=200, required=False

0 commit comments

Comments
 (0)