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

Fixes #2940: Allow CSV import of prefixes/IPs to VRF without an RD assigned

This commit is contained in:
Jeremy Stretch
2019-03-11 12:34:19 -04:00
parent ea11e70e3f
commit f4b85751bb
2 changed files with 7 additions and 6 deletions

View File

@ -349,11 +349,11 @@ class PrefixForm(BootstrapMixin, TenancyForm, CustomFieldForm):
class PrefixCSVForm(forms.ModelForm):
vrf = forms.ModelChoiceField(
vrf = FlexibleModelChoiceField(
queryset=VRF.objects.all(),
required=False,
to_field_name='rd',
help_text='Route distinguisher of parent VRF',
required=False,
help_text='Route distinguisher of parent VRF (or {ID})',
error_messages={
'invalid_choice': 'VRF not found.',
}
@ -764,11 +764,11 @@ class IPAddressBulkAddForm(BootstrapMixin, TenancyForm, CustomFieldForm):
class IPAddressCSVForm(forms.ModelForm):
vrf = forms.ModelChoiceField(
vrf = FlexibleModelChoiceField(
queryset=VRF.objects.all(),
required=False,
to_field_name='rd',
help_text='Route distinguisher of the assigned VRF',
required=False,
help_text='Route distinguisher of parent VRF (or {ID})',
error_messages={
'invalid_choice': 'VRF not found.',
}