Skip to content

Commit edb7d24

Browse files
Added installed_module on NestedModuleBaySerializer (#15245)
* added installed_module on NestedModuleBaySerializer #15243 * Update test --------- Co-authored-by: Jeremy Stretch <[email protected]>
1 parent 17ec264 commit edb7d24

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

netbox/dcim/api/nested_serializers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,11 @@ class Meta:
414414

415415
class NestedModuleBaySerializer(WritableNestedSerializer):
416416
url = serializers.HyperlinkedIdentityField(view_name='dcim-api:modulebay-detail')
417-
module = NestedModuleSerializer(required=False, read_only=True, allow_null=True)
417+
installed_module = ModuleBayNestedModuleSerializer(required=False, allow_null=True)
418418

419419
class Meta:
420420
model = models.ModuleBay
421-
fields = ['id', 'url', 'display', 'module', 'name']
421+
fields = ['id', 'url', 'display', 'installed_module', 'name']
422422

423423

424424
class NestedDeviceBaySerializer(WritableNestedSerializer):

netbox/dcim/api/serializers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,8 +1039,7 @@ class Meta:
10391039
model = ModuleBay
10401040
fields = [
10411041
'id', 'url', 'display', 'device', 'name', 'installed_module', 'label', 'position', 'description', 'tags',
1042-
'custom_fields',
1043-
'created', 'last_updated',
1042+
'custom_fields', 'created', 'last_updated',
10441043
]
10451044

10461045

netbox/dcim/tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ def setUpTestData(cls):
17551755

17561756
class ModuleBayTest(APIViewTestCases.APIViewTestCase):
17571757
model = ModuleBay
1758-
brief_fields = ['display', 'id', 'module', 'name', 'url']
1758+
brief_fields = ['display', 'id', 'installed_module', 'name', 'url']
17591759
bulk_update_data = {
17601760
'description': 'New description',
17611761
}

0 commit comments

Comments
 (0)