netbox: Device_count is not updated on device roles if a device is removed/add to the role
Environment
- Python version: v3.6.8
- NetBox version: v2.6.5
Steps to Reproduce
- Create a new device role
- Add an existing device to it
- Check the api response on
device_count - Remove the device from it
- Check the api response on
device_count
Expected Behavior
I expect the device_count to be correctly updated
Observed Behavior
When adding an existing device to the role, the role’s device_count stays at null.
When a new device is created and added to the role directly, the device_count is still null.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 15 (15 by maintainers)
Commits related to this issue
- #3672 changelog — committed to netbox-community/netbox by lampwins 4 years ago
FYI I am looking into what it will take to solve this upstream in cacheops by supporting subqueries natively.