mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 03:46:25 -06:00
Fix CSV import tests
This commit is contained in:
parent
9b3651bd35
commit
381657d22e
@ -15,7 +15,8 @@ from .forms import BootstrapMixin
|
|||||||
|
|
||||||
class ImportForm(BootstrapMixin, SyncedDataMixin, forms.Form):
|
class ImportForm(BootstrapMixin, SyncedDataMixin, forms.Form):
|
||||||
import_method = forms.ChoiceField(
|
import_method = forms.ChoiceField(
|
||||||
choices=ImportMethodChoices
|
choices=ImportMethodChoices,
|
||||||
|
required=False
|
||||||
)
|
)
|
||||||
data = forms.CharField(
|
data = forms.CharField(
|
||||||
required=False,
|
required=False,
|
||||||
@ -37,7 +38,7 @@ class ImportForm(BootstrapMixin, SyncedDataMixin, forms.Form):
|
|||||||
super().clean()
|
super().clean()
|
||||||
|
|
||||||
# Determine import method
|
# Determine import method
|
||||||
import_method = self.cleaned_data['import_method']
|
import_method = self.cleaned_data.get('import_method') or ImportMethodChoices.DIRECT
|
||||||
|
|
||||||
# Determine whether we're reading from form data or an uploaded file
|
# Determine whether we're reading from form data or an uploaded file
|
||||||
if self.cleaned_data['data'] and import_method != ImportMethodChoices.DIRECT:
|
if self.cleaned_data['data'] and import_method != ImportMethodChoices.DIRECT:
|
||||||
|
Loading…
Reference in New Issue
Block a user