mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-10 13:52:17 -06:00
Fixes #5507: Fix custom field data assignment via UI for IP addresses, secrets
This commit is contained in:
@@ -122,6 +122,7 @@ class SecretForm(BootstrapMixin, CustomFieldModelForm):
|
||||
self.fields['plaintext'].required = True
|
||||
|
||||
def clean(self):
|
||||
super().clean()
|
||||
|
||||
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.")
|
||||
|
||||
Reference in New Issue
Block a user