[PR #13804] [MERGED] 13757 Fix ConfigContext reference to DeviceType #14252

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13804
Author: @arthanson
Created: 9/18/2023
Status: Merged
Merged: 9/20/2023
Merged by: @jeremystretch

Base: developHead: 13757-config-context-device-type


📝 Commits (3)

  • 382a592 13757 do prefetch to work around Django issue with vars in init (DeviceType)
  • ad7ba0e 13757 use self.__dict to access vars in init
  • 5ee239c 13757 change test

📊 Changes

7 files changed (+16 additions, -14 deletions)

View changed files

📝 netbox/dcim/models/cables.py (+2 -2)
📝 netbox/dcim/models/device_component_templates.py (+1 -1)
📝 netbox/dcim/models/device_components.py (+1 -1)
📝 netbox/dcim/models/devices.py (+3 -3)
📝 netbox/extras/models/customfields.py (+1 -1)
📝 netbox/extras/tests/test_views.py (+6 -4)
📝 netbox/ipam/models/ip.py (+2 -2)

📄 Description

Fixes: #13757

As per Django issue https://code.djangoproject.com/ticket/34847 problem arises as DeviceType has variable references in init method. Recommendation is to access vars in init with self.__dict as they state this will probably be documented this way as there is no good fix for dereferenced vars except for this.

Changed ConfigContext test case save devicetype to catch if this ever regresses.


🔄 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/13804 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 9/18/2023 **Status:** ✅ Merged **Merged:** 9/20/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `13757-config-context-device-type` --- ### 📝 Commits (3) - [`382a592`](https://github.com/netbox-community/netbox/commit/382a592aaaaa3854877bc22678958050c5f6536d) 13757 do prefetch to work around Django issue with vars in init (DeviceType) - [`ad7ba0e`](https://github.com/netbox-community/netbox/commit/ad7ba0ed3f3c3fea5387446e8b00cf5439beeac6) 13757 use self.__dict to access vars in init - [`5ee239c`](https://github.com/netbox-community/netbox/commit/5ee239cae365b33d2c6d76858ff6a5db9eedbdcc) 13757 change test ### 📊 Changes **7 files changed** (+16 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/models/cables.py` (+2 -2) 📝 `netbox/dcim/models/device_component_templates.py` (+1 -1) 📝 `netbox/dcim/models/device_components.py` (+1 -1) 📝 `netbox/dcim/models/devices.py` (+3 -3) 📝 `netbox/extras/models/customfields.py` (+1 -1) 📝 `netbox/extras/tests/test_views.py` (+6 -4) 📝 `netbox/ipam/models/ip.py` (+2 -2) </details> ### 📄 Description ### Fixes: #13757 As per Django issue https://code.djangoproject.com/ticket/34847 problem arises as DeviceType has variable references in init method. Recommendation is to access vars in init with self.__dict as they state this will probably be documented this way as there is no good fix for dereferenced vars except for this. Changed ConfigContext test case save devicetype to catch if this ever regresses. --- <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 23:23:26 +01:00
adam closed this issue 2025-12-29 23:23:26 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14252