Closes #3676: Reference VRF by name rather than RD during IP/prefix import

This commit is contained in:
Jeremy Stretch
2020-03-30 15:54:35 -04:00
parent 5cf872d000
commit aa38dcf490
3 changed files with 21 additions and 12 deletions

View File

@@ -335,9 +335,9 @@ class PrefixForm(BootstrapMixin, TenancyForm, CustomFieldModelForm):
class PrefixCSVForm(CustomFieldModelCSVForm):
vrf = FlexibleModelChoiceField(
queryset=VRF.objects.all(),
to_field_name='rd',
to_field_name='name',
required=False,
help_text='Route distinguisher of parent VRF (or {ID})',
help_text='Name of parent VRF (or {ID})',
error_messages={
'invalid_choice': 'VRF not found.',
}
@@ -739,9 +739,9 @@ class IPAddressBulkAddForm(BootstrapMixin, TenancyForm, CustomFieldModelForm):
class IPAddressCSVForm(CustomFieldModelCSVForm):
vrf = FlexibleModelChoiceField(
queryset=VRF.objects.all(),
to_field_name='rd',
to_field_name='name',
required=False,
help_text='Route distinguisher of parent VRF (or {ID})',
help_text='Name of parent VRF (or {ID})',
error_messages={
'invalid_choice': 'VRF not found.',
}