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

Fixes #1926: Prevent reassignment of parent device when bulk editing VC member interfaces

This commit is contained in:
Jeremy Stretch
2018-03-01 13:10:36 -05:00
parent 4bb526896f
commit 078404fb59
4 changed files with 6 additions and 16 deletions

View File

@ -539,9 +539,11 @@ class ComponentForm(BootstrapMixin, forms.Form):
class BulkEditForm(forms.Form):
def __init__(self, model, *args, **kwargs):
def __init__(self, model, parent_obj=None, *args, **kwargs):
super(BulkEditForm, self).__init__(*args, **kwargs)
self.model = model
self.parent_obj = parent_obj
# Copy any nullable fields defined in Meta
if hasattr(self.Meta, 'nullable_fields'):
self.nullable_fields = [field for field in self.Meta.nullable_fields]