Fix endpoint form clean handling for NetBox 4.6
This commit is contained in:
@@ -6,3 +6,4 @@
|
|||||||
| 0.1.1 | 4.4.0 | 4.5.x |
|
| 0.1.1 | 4.4.0 | 4.5.x |
|
||||||
| 0.1.2 | 4.4.0 | 4.5.x |
|
| 0.1.2 | 4.4.0 | 4.5.x |
|
||||||
| 0.1.3 | 4.4.0 | 4.5.x |
|
| 0.1.3 | 4.4.0 | 4.5.x |
|
||||||
|
| 0.1.4 | 4.4.0 | 4.6.x |
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class VMwareImporterConfig(PluginConfig):
|
|||||||
name = "netbox_vmware_importer"
|
name = "netbox_vmware_importer"
|
||||||
verbose_name = "VMware Importer"
|
verbose_name = "VMware Importer"
|
||||||
description = "Synchronize VMware vSphere virtual machines into NetBox."
|
description = "Synchronize VMware vSphere virtual machines into NetBox."
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
author = "Internal NetBox Team"
|
author = "Internal NetBox Team"
|
||||||
base_url = "vmware-importer"
|
base_url = "vmware-importer"
|
||||||
min_version = "4.4.0"
|
min_version = "4.4.0"
|
||||||
|
|||||||
@@ -83,13 +83,13 @@ class VCenterEndpointForm(NetBoxModelForm):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
cleaned_data = super().clean()
|
super().clean()
|
||||||
password = cleaned_data.get("password")
|
password = self.cleaned_data.get("password")
|
||||||
|
|
||||||
if not self.instance.pk and not password:
|
if not self.instance.pk and not password:
|
||||||
raise ValidationError({"password": _("A password is required for new endpoints.")})
|
raise ValidationError({"password": _("A password is required for new endpoints.")})
|
||||||
|
|
||||||
return cleaned_data
|
return self.cleaned_data
|
||||||
|
|
||||||
def save(self, commit=True):
|
def save(self, commit=True):
|
||||||
obj = super().save(commit=False)
|
obj = super().save(commit=False)
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "netbox-vmware-importer"
|
name = "netbox-vmware-importer"
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
description = "NetBox plugin to synchronize VMware vSphere virtual machines into NetBox."
|
description = "NetBox plugin to synchronize VMware vSphere virtual machines into NetBox."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
|
|||||||
Reference in New Issue
Block a user