[PR #4904] [CLOSED] Make sure counts in search results are for distinct objects #12943

Closed
opened 2025-12-29 22:24:30 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4904
Author: @steffann
Created: 7/27/2020
Status: Closed

Base: develop-2.9Head: 4903-member-count


📝 Commits (1)

  • e7ee44f Make sure counts in search results are for distinct objects

📊 Changes

1 file changed (+9 additions, -13 deletions)

View changed files

📝 netbox/netbox/views.py (+9 -13)

📄 Description

Fixes: #4903

Virtual Chassis members were counted multiple times in search results. I added distinct=True to Count to make sure it returns the number of unique members. I added this to all counts in SEARCH_TYPES to make sure the same counting error doesn't occur for other object types as well,


🔄 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/4904 **Author:** [@steffann](https://github.com/steffann) **Created:** 7/27/2020 **Status:** ❌ Closed **Base:** `develop-2.9` ← **Head:** `4903-member-count` --- ### 📝 Commits (1) - [`e7ee44f`](https://github.com/netbox-community/netbox/commit/e7ee44f673bac13f25ccffb4473678bcc6f5af5e) Make sure counts in search results are for distinct objects ### 📊 Changes **1 file changed** (+9 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/views.py` (+9 -13) </details> ### 📄 Description ### Fixes: #4903 Virtual Chassis members were counted multiple times in search results. I added `distinct=True` to `Count` to make sure it returns the number of unique members. I added this to all counts in `SEARCH_TYPES` to make sure the same counting error doesn't occur for other object types as well, --- <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-29 22:24:30 +01:00
adam closed this issue 2025-12-29 22:24:30 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12943