Merge pull request #4031 from kobayashi/3978-add-vrf-filter

Fixes #3978: VRF filtering for NAT IP search
This commit is contained in:
Jeremy Stretch 2020-01-28 13:46:54 -05:00 committed by GitHub
commit 2a4ccae113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -5,6 +5,7 @@
* [#3310](https://github.com/netbox-community/netbox/issues/3310) - Pre-select site/rack for B side when creating a new cable
* [#3338](https://github.com/netbox-community/netbox/issues/3338) - Include circuit terminations in API representation of circuits
* [#3509](https://github.com/netbox-community/netbox/issues/3509) - Add IP address variables for custom scripts
* [#3978](https://github.com/netbox-community/netbox/issues/3978) - Add VRF filtering to search NAT IP
* [#4005](https://github.com/netbox-community/netbox/issues/4005) - Include timezone context in webhook timestamps
## Bug Fixes

View File

@ -635,6 +635,17 @@ class IPAddressForm(BootstrapMixin, TenancyForm, ReturnURLForm, CustomFieldForm)
}
)
)
nat_vrf = forms.ModelChoiceField(
queryset=VRF.objects.all(),
required=False,
label='VRF',
widget=APISelect(
api_url="/api/ipam/vrfs/",
filter_for={
'nat_inside': 'vrf_id'
}
)
)
nat_inside = ChainedModelChoiceField(
queryset=IPAddress.objects.all(),
chains=(

View File

@ -61,7 +61,7 @@
{% render_field form.nat_device %}
</div>
<div class="tab-pane" id="search">
&nbsp;
{% render_field form.nat_vrf %}
</div>
</div>
{% render_field form.nat_inside %}