Fixes #7849: Fix exception when creating an FHRPGroup with an invalid IP address

This commit is contained in:
jeremystretch 2021-11-16 16:50:20 -05:00
parent 500f213c6b
commit 6f7fbf7686
2 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@
* [#7757](https://github.com/netbox-community/netbox/issues/7757) - Fix 404 when assigning multiple contacts/FHRP groups in succession * [#7757](https://github.com/netbox-community/netbox/issues/7757) - Fix 404 when assigning multiple contacts/FHRP groups in succession
* [#7768](https://github.com/netbox-community/netbox/issues/7768) - Validate IP address status when creating a new FHRP group * [#7768](https://github.com/netbox-community/netbox/issues/7768) - Validate IP address status when creating a new FHRP group
* [#7771](https://github.com/netbox-community/netbox/issues/7771) - Group assignment should be optional when creating contacts via REST API * [#7771](https://github.com/netbox-community/netbox/issues/7771) - Group assignment should be optional when creating contacts via REST API
* [#7849](https://github.com/netbox-community/netbox/issues/7849) - Fix exception when creating an FHRPGroup with an invalid IP address
--- ---

View File

@ -587,8 +587,8 @@ class FHRPGroupForm(BootstrapMixin, CustomFieldModelForm):
return instance return instance
def clean(self): def clean(self):
ip_address = self.cleaned_data['ip_address'] ip_address = self.cleaned_data.get('ip_address')
ip_status = self.cleaned_data['ip_status'] ip_status = self.cleaned_data.get('ip_status')
if ip_address and not ip_status: if ip_address and not ip_status:
raise forms.ValidationError({ raise forms.ValidationError({