File tree 2 files changed +2
-11
lines changed
2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change 11
11
12
12
* [ #7674 ] ( https://github.com/netbox-community/netbox/issues/7674 ) - Fix inadvertent application of device type context to virtual machines
13
13
* [ #8074 ] ( https://github.com/netbox-community/netbox/issues/8074 ) - Ordering VMs by name should reference naturalized value
14
+ * [ #8077 ] ( https://github.com/netbox-community/netbox/issues/8077 ) - Fix exception when attaching image to location, circuit, or power panel
14
15
* [ #8078 ] ( https://github.com/netbox-community/netbox/issues/8078 ) - Add missing wireless models to ` lsmodels() ` in ` nbshell `
15
16
* [ #8079 ] ( https://github.com/netbox-community/netbox/issues/8079 ) - Fix validation of LLDP neighbors when connected device has an asset tag
16
17
Original file line number Diff line number Diff line change @@ -170,17 +170,7 @@ def validate(self, data):
170
170
171
171
@swagger_serializer_method (serializer_or_field = serializers .DictField )
172
172
def get_parent (self , obj ):
173
-
174
- # Static mapping of models to their nested serializers
175
- if isinstance (obj .parent , Device ):
176
- serializer = NestedDeviceSerializer
177
- elif isinstance (obj .parent , Rack ):
178
- serializer = NestedRackSerializer
179
- elif isinstance (obj .parent , Site ):
180
- serializer = NestedSiteSerializer
181
- else :
182
- raise Exception ("Unexpected type of parent object for ImageAttachment" )
183
-
173
+ serializer = get_serializer_for_model (obj .parent , prefix = 'Nested' )
184
174
return serializer (obj .parent , context = {'request' : self .context ['request' ]}).data
185
175
186
176
You can’t perform that action at this time.
0 commit comments