add ordering to avoid exceptions in netbox > v4.4.0
- API paginator raises out when queryset is not ordered https://github.com/netbox-community/netbox/issues/18900
Thanks for the fix. I haven't seen this error before. What causes it?
This https://github.com/netbox-community/netbox/blob/main/netbox/netbox/api/pagination.py#L20-L23
it's set as the paginator class for DRF https://github.com/netbox-community/netbox/blob/main/netbox/netbox/settings.py#L703
so basically any DRF view that paginates needs to be ordered otherwise it'll raise out unless the pagination is overloaded in the view subclass
*note this seems to have appeared in recent versions
I see, maybe it wasn't caught by the existing API tests because there aren't many objects returned to invoke the paginator. Could you add a test? It should fail if this patch isn't applied.