File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
## Bug Fixes
8
8
9
+ * [ #3900 ] ( https://github.com/netbox-community/netbox/issues/3900 ) - Fix exception when deleting device types
9
10
* [ #3914 ] ( https://github.com/netbox-community/netbox/issues/3914 ) - Fix interface filter field when unauthenticated
10
11
11
12
---
Original file line number Diff line number Diff line change @@ -38,11 +38,18 @@ def instantiate(self, device):
38
38
raise NotImplementedError ()
39
39
40
40
def to_objectchange (self , action ):
41
+ # Annotate the parent DeviceType
42
+ try :
43
+ parent = getattr (self , 'device_type' , None )
44
+ except ObjectDoesNotExist :
45
+ # The parent DeviceType has already been deleted
46
+ parent = None
47
+
41
48
return ObjectChange (
42
49
changed_object = self ,
43
50
object_repr = str (self ),
44
51
action = action ,
45
- related_object = self . device_type ,
52
+ related_object = parent ,
46
53
object_data = serialize_object (self )
47
54
)
48
55
You can’t perform that action at this time.
0 commit comments