Explorar o código

Fixes #2938: Enforce deterministic ordering of device components returned by API

Jeremy Stretch %!s(int64=7) %!d(string=hai) anos
pai
achega
32f63a18ff
Modificáronse 2 ficheiros con 2 adicións e 1 borrados
  1. 1 0
      CHANGELOG.md
  2. 1 1
      netbox/dcim/managers.py

+ 1 - 0
CHANGELOG.md

@@ -4,6 +4,7 @@ v2.5.8 (FUTURE)
 
 * [#2705](https://github.com/digitalocean/netbox/issues/2705) - Fix endpoint grouping in API docs
 * [#2923](https://github.com/digitalocean/netbox/issues/2923) - Provider filter form's site field should be blank by default
+* [#2938](https://github.com/digitalocean/netbox/issues/2938) - Enforce deterministic ordering of device components returned by API
 
 ---
 

+ 1 - 1
netbox/dcim/managers.py

@@ -27,7 +27,7 @@ class DeviceComponentManager(Manager):
             select={
                 'name_padded': sql.format(table_name, table_name),
             }
-        ).order_by('name_padded')
+        ).order_by('name_padded', 'pk')
 
 
 class InterfaceQuerySet(QuerySet):