[PR #19961] [MERGED] Fixes: #19917 - Fix MAC address pagination duplicates by adding 'pk' to model ordering #15774

Closed
opened 2025-12-30 00:23:59 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19961
Author: @jseifeddine
Created: 7/28/2025
Status: Merged
Merged: 8/4/2025
Merged by: @jeremystretch

Base: mainHead: 19917-fix-mac-address-pagination-duplicates


📝 Commits (3)

  • f25dd7a Fix MAC address pagination duplicates by adding 'pk' to model ordering
  • 375b1dc Remove test
  • 3d2cf79 Resolve migration conflict

📊 Changes

2 files changed (+20 additions, -1 deletions)

View changed files

netbox/dcim/migrations/0210_macaddress_ordering.py (+19 -0)
📝 netbox/dcim/models/devices.py (+1 -1)

📄 Description

Fixes: #19917

Fix MAC address pagination by ensuring deterministic ordering
Add pk to MACAddress model ordering to ensure deterministic results
when multiple MAC addresses have the same value. This prevents the same
MAC address from appearing on multiple pages during pagination.

The issue occurred because Django's default ordering by 'mac_address'
alone is non-deterministic when multiple records share the same MAC
address value, causing inconsistent pagination results.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/19961 **Author:** [@jseifeddine](https://github.com/jseifeddine) **Created:** 7/28/2025 **Status:** ✅ Merged **Merged:** 8/4/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `19917-fix-mac-address-pagination-duplicates` --- ### 📝 Commits (3) - [`f25dd7a`](https://github.com/netbox-community/netbox/commit/f25dd7aab702b71467665f1b1ddb4ece81e52220) Fix MAC address pagination duplicates by adding 'pk' to model ordering - [`375b1dc`](https://github.com/netbox-community/netbox/commit/375b1dc2ba61149dc71d5c52f3703e720d8a62c5) Remove test - [`3d2cf79`](https://github.com/netbox-community/netbox/commit/3d2cf792220f2c5f1fcccb27febe125b27d79105) Resolve migration conflict ### 📊 Changes **2 files changed** (+20 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `netbox/dcim/migrations/0210_macaddress_ordering.py` (+19 -0) 📝 `netbox/dcim/models/devices.py` (+1 -1) </details> ### 📄 Description ### Fixes: #19917 Fix MAC address pagination by ensuring deterministic ordering Add `pk` to MACAddress model ordering to ensure deterministic results when multiple MAC addresses have the same value. This prevents the same MAC address from appearing on multiple pages during pagination. The issue occurred because Django's default ordering by 'mac_address' alone is non-deterministic when multiple records share the same MAC address value, causing inconsistent pagination results. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:23:59 +01:00
adam closed this issue 2025-12-30 00:23:59 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15774