Przeglądaj źródła

Fixes #2762: Add missing DCIM field values to API _choices endpoint

Jeremy Stretch 7 lat temu
rodzic
commit
73a1d6a7ba
2 zmienionych plików z 9 dodań i 3 usunięć
  1. 1 0
      CHANGELOG.md
  2. 8 3
      netbox/dcim/api/views.py

+ 1 - 0
CHANGELOG.md

@@ -12,6 +12,7 @@ v2.5.3 (FUTURE)
 ## Bug Fixes
 
 * [#2742](https://github.com/digitalocean/netbox/issues/2742) - Preserve cluster assignment when editing a device
+* [#2762](https://github.com/digitalocean/netbox/issues/2762) - Add missing DCIM field values to API `_choices` endpoint
 
 
 ---

+ 8 - 3
netbox/dcim/api/views.py

@@ -35,13 +35,18 @@ from .exceptions import MissingFilterException
 
 class DCIMFieldChoicesViewSet(FieldChoicesViewSet):
     fields = (
-        (Cable, ['length_unit']),
-        (Device, ['face', 'status']),
+        (Cable, ['length_unit', 'status', 'type']),
         (ConsolePort, ['connection_status']),
-        (Interface, ['connection_status', 'form_factor', 'mode']),
+        (Device, ['face', 'status']),
+        (DeviceType, ['subdevice_role']),
+        (FrontPort, ['type']),
+        (FrontPortTemplate, ['type']),
+        (Interface, ['form_factor', 'mode']),
         (InterfaceTemplate, ['form_factor']),
         (PowerPort, ['connection_status']),
         (Rack, ['outer_unit', 'status', 'type', 'width']),
+        (RearPort, ['type']),
+        (RearPortTemplate, ['type']),
         (Site, ['status']),
     )