Skip to content

Commit e87877b

Browse files
committed
Fixes #15771: Show id field as supported on all bulk import forms
1 parent ebe504c commit e87877b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

netbox/netbox/forms/base.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ class NetBoxModelImportForm(CSVModelForm, NetBoxModelForm):
7373
"""
7474
Base form for creating a NetBox objects from CSV data. Used for bulk importing.
7575
"""
76-
id = forms.IntegerField(
77-
label=_('Id'),
78-
required=False,
79-
help_text='Numeric ID of an existing object to update (if not creating a new object)'
80-
)
8176
tags = CSVModelMultipleChoiceField(
8277
label=_('Tags'),
8378
queryset=Tag.objects.all(),

netbox/utilities/forms/forms.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ class CSVModelForm(forms.ModelForm):
7070
"""
7171
ModelForm used for the import of objects in CSV format.
7272
"""
73+
id = forms.IntegerField(
74+
label=_('ID'),
75+
required=False,
76+
help_text=_('Numeric ID of an existing object to update (if not creating a new object)')
77+
)
78+
7379
def __init__(self, *args, headers=None, **kwargs):
7480
self.headers = headers or {}
7581
super().__init__(*args, **kwargs)

0 commit comments

Comments
 (0)