mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 17:08:41 -06:00
Fixes #7768: Validate IP address status when creating a new FHRP group
This commit is contained in:
parent
2ce8ef5704
commit
17fd6e692e
@ -3,6 +3,7 @@
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* [#7756](https://github.com/netbox-community/netbox/issues/7756) - Fix AttributeError exception when editing an IP address assigned to a FHRPGroup
|
* [#7756](https://github.com/netbox-community/netbox/issues/7756) - Fix AttributeError exception when editing an IP address assigned to a FHRPGroup
|
||||||
|
* [#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
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -576,6 +576,15 @@ class FHRPGroupForm(BootstrapMixin, CustomFieldModelForm):
|
|||||||
|
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
|
def clean(self):
|
||||||
|
ip_address = self.cleaned_data['ip_address']
|
||||||
|
ip_status = self.cleaned_data['ip_status']
|
||||||
|
|
||||||
|
if ip_address and not ip_status:
|
||||||
|
raise forms.ValidationError({
|
||||||
|
'ip_status': "Status must be set when creating a new IP address."
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
class FHRPGroupAssignmentForm(BootstrapMixin, forms.ModelForm):
|
class FHRPGroupAssignmentForm(BootstrapMixin, forms.ModelForm):
|
||||||
group = DynamicModelChoiceField(
|
group = DynamicModelChoiceField(
|
||||||
|
Loading…
Reference in New Issue
Block a user