[PR #11567] [MERGED] 11432 device field #13812

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/11567
Author: @arthanson
Created: 1/23/2023
Status: Merged
Merged: 4/12/2023
Merged by: @jeremystretch

Base: developHead: 11432-device-field


📝 Commits (10+)

  • 53f6b9f 11432 make device field on interface read-only on api edit call
  • e72a7fa 11432 make device field on interface read-only on api edit call
  • bea3426 Merge branch 'develop' into 11432-device-field
  • 8e01b20 11432 extend serializer change to mixin
  • 676c849 Merge branch 'develop' into 11432-device-field
  • 29bbef4 11432 add readonlydevicemixin to template serializers
  • 6d9deec 11432 change subclass ordering
  • c1ed038 Merge branch 'develop' into 11432-device-field
  • f56db90 11432 fix device_type for template serializers
  • 36d3c84 11432 DRY

📊 Changes

2 files changed (+25 additions, -0 deletions)

View changed files

📝 netbox/dcim/models/device_component_templates.py (+11 -0)
📝 netbox/dcim/models/device_components.py (+14 -0)

📄 Description

Fixes: #11432

Makes the device field for interface read-only if a patch request. The 'normal' way of doing this would be by override get_extra_kwargs, but that doesn't work if the field is explicitly declared (which this is). As read-only it is just ignored if the patch is done which is the DRF convention.


🔄 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/11567 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 1/23/2023 **Status:** ✅ Merged **Merged:** 4/12/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `11432-device-field` --- ### 📝 Commits (10+) - [`53f6b9f`](https://github.com/netbox-community/netbox/commit/53f6b9f17a9843c93331e0b1c5fa8ca0b704ee4e) 11432 make device field on interface read-only on api edit call - [`e72a7fa`](https://github.com/netbox-community/netbox/commit/e72a7fa401191525065199df474a176df14823a2) 11432 make device field on interface read-only on api edit call - [`bea3426`](https://github.com/netbox-community/netbox/commit/bea3426ad64c7fd04276ca1f8fb2d70078839dab) Merge branch 'develop' into 11432-device-field - [`8e01b20`](https://github.com/netbox-community/netbox/commit/8e01b2008f2d5336ef5935affefe660cdec3b749) 11432 extend serializer change to mixin - [`676c849`](https://github.com/netbox-community/netbox/commit/676c849f139603a11e2c80afc23f785402ffc9ea) Merge branch 'develop' into 11432-device-field - [`29bbef4`](https://github.com/netbox-community/netbox/commit/29bbef4c5d393d43fbe6254b89441f563f6a9611) 11432 add readonlydevicemixin to template serializers - [`6d9deec`](https://github.com/netbox-community/netbox/commit/6d9deec1a659949500007bc6d06837d1c065d1e5) 11432 change subclass ordering - [`c1ed038`](https://github.com/netbox-community/netbox/commit/c1ed038fce1cf35f5c7a9719a499c1dba600e408) Merge branch 'develop' into 11432-device-field - [`f56db90`](https://github.com/netbox-community/netbox/commit/f56db90275469bf80c9cab1d4966c445d161190e) 11432 fix device_type for template serializers - [`36d3c84`](https://github.com/netbox-community/netbox/commit/36d3c848034aa4166a6df9c9159e620ea04dde78) 11432 DRY ### 📊 Changes **2 files changed** (+25 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/models/device_component_templates.py` (+11 -0) 📝 `netbox/dcim/models/device_components.py` (+14 -0) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #11432 <!-- Please include a summary of the proposed changes below. --> Makes the device field for interface read-only if a patch request. The 'normal' way of doing this would be by override get_extra_kwargs, but that doesn't work if the field is explicitly declared (which this is). As read-only it is just ignored if the patch is done which is the DRF convention. --- <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:20:56 +01:00
adam closed this issue 2025-12-29 23:20:57 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13812