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

Fixes #950: Fix site_id error on child device import

This commit is contained in:
Jeremy Stretch
2017-03-13 11:18:33 -04:00
parent 6a2a2d5d11
commit f661c233be
3 changed files with 27 additions and 15 deletions

View File

@ -680,13 +680,21 @@ class DeviceFromCSVForm(BaseDeviceFromCSVForm):
class ChildDeviceFromCSVForm(BaseDeviceFromCSVForm):
parent = FlexibleModelChoiceField(queryset=Device.objects.all(), to_field_name='name', required=False,
error_messages={'invalid_choice': 'Parent device not found.'})
parent = FlexibleModelChoiceField(
queryset=Device.objects.all(),
to_field_name='name',
required=False,
error_messages={
'invalid_choice': 'Parent device not found.'
}
)
device_bay_name = forms.CharField(required=False)
class Meta(BaseDeviceFromCSVForm.Meta):
fields = ['name', 'device_role', 'tenant', 'manufacturer', 'model_name', 'platform', 'serial', 'asset_tag',
'parent', 'device_bay_name']
fields = [
'name', 'device_role', 'tenant', 'manufacturer', 'model_name', 'platform', 'serial', 'asset_tag', 'parent',
'device_bay_name',
]
def clean(self):