Skip to content

Commit

Permalink
Fixes #15771: Show id field as supported on all bulk import forms
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Apr 22, 2024
1 parent b6e38b2 commit 0a32a84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 0 additions & 5 deletions netbox/netbox/forms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ class NetBoxModelImportForm(CSVModelForm, NetBoxModelForm):
"""
Base form for creating a NetBox objects from CSV data. Used for bulk importing.
"""
id = forms.IntegerField(
label=_('Id'),
required=False,
help_text='Numeric ID of an existing object to update (if not creating a new object)'
)
tags = CSVModelMultipleChoiceField(
label=_('Tags'),
queryset=Tag.objects.all(),
Expand Down
6 changes: 6 additions & 0 deletions netbox/utilities/forms/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class CSVModelForm(forms.ModelForm):
"""
ModelForm used for the import of objects in CSV format.
"""
id = forms.IntegerField(
label=_('ID'),
required=False,
help_text=_('Numeric ID of an existing object to update (if not creating a new object)')
)

def __init__(self, *args, headers=None, **kwargs):
self.headers = headers or {}
super().__init__(*args, **kwargs)
Expand Down

0 comments on commit 0a32a84

Please sign in to comment.