[PR #12781] [MERGED] 9077 audit alters_data=True #14047

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/12781
Author: @arthanson
Created: 5/31/2023
Status: Merged
Merged: 6/14/2023
Merged by: @jeremystretch

Base: featureHead: 9077-alters-data


📝 Commits (1)

  • ee6926d 9077 audit alters_data=True

📊 Changes

7 files changed (+21 additions, -0 deletions)

View changed files

📝 netbox/core/models/data.py (+1 -0)
📝 netbox/dcim/models/cables.py (+2 -0)
📝 netbox/dcim/models/device_component_templates.py (+9 -0)
📝 netbox/extras/models/configs.py (+2 -0)
📝 netbox/extras/models/models.py (+2 -0)
📝 netbox/extras/models/staging.py (+1 -0)
📝 netbox/netbox/models/features.py (+4 -0)

📄 Description

Fixes: #9077

adds alters_data=True to model functions with no params that modify data also sets some do_not_call_in_templates for several that should just be skipped.

Tested by manually setting string_if_invalid in settings and temporarily calling the method in a template to make sure it was skipped. easiest one is adding a call to sync_data in exporttemplate.html as it will throw an Attribute Error if the alters_data setting is removed.


🔄 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/12781 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 5/31/2023 **Status:** ✅ Merged **Merged:** 6/14/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `9077-alters-data` --- ### 📝 Commits (1) - [`ee6926d`](https://github.com/netbox-community/netbox/commit/ee6926da2cf4c1387bb98ca69d9a34cf92aaa028) 9077 audit alters_data=True ### 📊 Changes **7 files changed** (+21 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/core/models/data.py` (+1 -0) 📝 `netbox/dcim/models/cables.py` (+2 -0) 📝 `netbox/dcim/models/device_component_templates.py` (+9 -0) 📝 `netbox/extras/models/configs.py` (+2 -0) 📝 `netbox/extras/models/models.py` (+2 -0) 📝 `netbox/extras/models/staging.py` (+1 -0) 📝 `netbox/netbox/models/features.py` (+4 -0) </details> ### 📄 Description ### Fixes: #9077 adds alters_data=True to model functions with no params that modify data also sets some do_not_call_in_templates for several that should just be skipped. Tested by manually setting string_if_invalid in settings and temporarily calling the method in a template to make sure it was skipped. easiest one is adding a call to sync_data in exporttemplate.html as it will throw an Attribute Error if the alters_data setting is removed. --- <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:22:13 +01:00
adam closed this issue 2025-12-29 23:22:13 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14047