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

Remove obsolete ComponentForm

This commit is contained in:
Jeremy Stretch
2020-02-06 11:36:25 -05:00
parent 71601aad39
commit a2475ee501
4 changed files with 26 additions and 35 deletions

View File

@@ -727,15 +727,6 @@ class ConfirmationForm(BootstrapMixin, ReturnURLForm):
confirm = forms.BooleanField(required=True, widget=forms.HiddenInput(), initial=True)
# TODO: Remove ComponentForm
class ComponentForm(BootstrapMixin, forms.Form):
"""
Allow inclusion of the parent Device/VirtualMachine as context for limiting field choices.
"""
def get_iterative_data(self, iteration):
return {}
class BulkEditForm(forms.Form):
"""
Base form for editing multiple objects in bulk

View File

@@ -854,7 +854,8 @@ class ComponentCreateView(GetReturnURLMixin, View):
# Initialize the individual component form
data['name'] = name
data.update(form.get_iterative_data(i))
if hasattr(form, 'get_iterative_data'):
data.update(form.get_iterative_data(i))
component_form = self.model_form(data)
if component_form.is_valid():