mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-17 04:32:51 -06:00
Fixes #5507: Fix custom field data assignment via UI for IP addresses, secrets
This commit is contained in:
parent
1e5778e6db
commit
158ed5765b
@ -18,6 +18,7 @@
|
|||||||
* [#5487](https://github.com/netbox-community/netbox/issues/5487) - Support filtering rack type/width with multiple values
|
* [#5487](https://github.com/netbox-community/netbox/issues/5487) - Support filtering rack type/width with multiple values
|
||||||
* [#5498](https://github.com/netbox-community/netbox/issues/5498) - Fix filtering rack reservations by username
|
* [#5498](https://github.com/netbox-community/netbox/issues/5498) - Fix filtering rack reservations by username
|
||||||
* [#5499](https://github.com/netbox-community/netbox/issues/5499) - Fix filtering of displayed device/VM interfaces by regex
|
* [#5499](https://github.com/netbox-community/netbox/issues/5499) - Fix filtering of displayed device/VM interfaces by regex
|
||||||
|
* [#5507](https://github.com/netbox-community/netbox/issues/5507) - Fix custom field data assignment via UI for IP addresses, secrets
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -774,6 +774,7 @@ class IPAddressForm(BootstrapMixin, TenancyForm, ReturnURLForm, CustomFieldModel
|
|||||||
self.initial['primary_for_parent'] = True
|
self.initial['primary_for_parent'] = True
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
super().clean()
|
||||||
|
|
||||||
# Cannot select both a device interface and a VM interface
|
# Cannot select both a device interface and a VM interface
|
||||||
if self.cleaned_data.get('interface') and self.cleaned_data.get('vminterface'):
|
if self.cleaned_data.get('interface') and self.cleaned_data.get('vminterface'):
|
||||||
|
@ -122,6 +122,7 @@ class SecretForm(BootstrapMixin, CustomFieldModelForm):
|
|||||||
self.fields['plaintext'].required = True
|
self.fields['plaintext'].required = True
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
super().clean()
|
||||||
|
|
||||||
if not self.cleaned_data['device'] and not self.cleaned_data['virtual_machine']:
|
if not self.cleaned_data['device'] and not self.cleaned_data['virtual_machine']:
|
||||||
raise forms.ValidationError("Secrets must be assigned to a device or virtual machine.")
|
raise forms.ValidationError("Secrets must be assigned to a device or virtual machine.")
|
||||||
|
Loading…
Reference in New Issue
Block a user