Przeglądaj źródła

Fixes #4992: Add display_name to nested VRF serializer

Jeremy Stretch 5 lat temu
rodzic
commit
acd5f21866

+ 4 - 0
docs/release-notes/version-2.8.md

@@ -6,6 +6,10 @@
 
 * [#4885](https://github.com/netbox-community/netbox/issues/4885) - Add MultiChoiceVar for custom scripts
 
+### Bug Fixes
+
+* [#4992](https://github.com/netbox-community/netbox/issues/4992) - Add `display_name` to nested VRF serializer
+
 ---
 
 ## v2.8.9 (2020-08-04)

+ 1 - 1
netbox/ipam/api/nested_serializers.py

@@ -26,7 +26,7 @@ class NestedVRFSerializer(WritableNestedSerializer):
 
     class Meta:
         model = models.VRF
-        fields = ['id', 'url', 'name', 'rd', 'prefix_count']
+        fields = ['id', 'url', 'name', 'rd', 'display_name', 'prefix_count']
 
 
 #

+ 1 - 1
netbox/ipam/tests/test_api.py

@@ -22,7 +22,7 @@ class AppTest(APITestCase):
 
 class VRFTest(APIViewTestCases.APIViewTestCase):
     model = VRF
-    brief_fields = ['id', 'name', 'prefix_count', 'rd', 'url']
+    brief_fields = ['display_name', 'id', 'name', 'prefix_count', 'rd', 'url']
     create_data = [
         {
             'name': 'VRF 4',