Explorar el Código

Fixes #13859: Fix valid response when no matching choice values are found

Jeremy Stretch hace 2 años
padre
commit
b759d694ee
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      netbox/extras/api/views.py

+ 4 - 1
netbox/extras/api/views.py

@@ -82,7 +82,10 @@ class CustomFieldChoiceSetViewSet(NetBoxModelViewSet):
             data = [
                 {'id': c[0], 'display': c[1]} for c in page
             ]
-            return self.get_paginated_response(data)
+        else:
+            data = []
+
+        return self.get_paginated_response(data)
 
 
 #