From 6f7fbf7686fa5425ff96f85582f6e1f1fda1a5a9 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 16 Nov 2021 16:50:20 -0500 Subject: [PATCH] Fixes #7849: Fix exception when creating an FHRPGroup with an invalid IP address --- docs/release-notes/version-3.1.md | 1 + netbox/ipam/forms/models.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index a8b1711c9..4c8379d48 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -13,6 +13,7 @@ * [#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 * [#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 --- diff --git a/netbox/ipam/forms/models.py b/netbox/ipam/forms/models.py index eea3bb216..baa5e738a 100644 --- a/netbox/ipam/forms/models.py +++ b/netbox/ipam/forms/models.py @@ -587,8 +587,8 @@ class FHRPGroupForm(BootstrapMixin, CustomFieldModelForm): return instance def clean(self): - ip_address = self.cleaned_data['ip_address'] - ip_status = self.cleaned_data['ip_status'] + ip_address = self.cleaned_data.get('ip_address') + ip_status = self.cleaned_data.get('ip_status') if ip_address and not ip_status: raise forms.ValidationError({