fix: handle None from NetBox form clean() in certificate form
NetBox 4.7 form mixins return None from clean(), which crashed adding a certificate with AttributeError. Use self.cleaned_data instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
2a41118e8e
commit
5dedfc9206
1 file changed
+3
-1
@@ -115,7 +115,9 @@ class CertificateForm(NetBoxModelForm):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
cleaned_data = super().clean()
|
# NetBox form mixins may return None from clean(), so always use self.cleaned_data
|
||||||
|
super().clean()
|
||||||
|
cleaned_data = self.cleaned_data
|
||||||
uploaded_file = cleaned_data.get("certificate_file")
|
uploaded_file = cleaned_data.get("certificate_file")
|
||||||
if isinstance(uploaded_file, UploadedFile):
|
if isinstance(uploaded_file, UploadedFile):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in new issue
Block a user