[PR #10525] [MERGED] 10491 improve error message for ProtectedError on contact assignment #13647

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/10525
Author: @arthanson
Created: 9/30/2022
Status: Merged
Merged: 10/3/2022
Merged by: @jeremystretch

Base: developHead: 10491-delete-dependant


📝 Commits (1)

  • 02ffc2d 10491 improve error message for ProtectedError on contact assignment

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 netbox/tenancy/models/contacts.py (+2 -2)

📄 Description

Fixes: #10491

@jeremystretch I wasn't sure if there were any side-effects from this str change. The error handler is at https://github.com/netbox-community/netbox/blob/develop/netbox/utilities/error_handlers.py#L12 For contacts since this is the side the error happens on the protected_objects str is showing the wrong end of the link. I think changing str to show self.object would break it in other places so showing both sides of the connection in the str seemed like the best approach?


🔄 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/10525 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 9/30/2022 **Status:** ✅ Merged **Merged:** 10/3/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `10491-delete-dependant` --- ### 📝 Commits (1) - [`02ffc2d`](https://github.com/netbox-community/netbox/commit/02ffc2ddeed9483de6e765f7f5b4205ce10ea2b3) 10491 improve error message for ProtectedError on contact assignment ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `netbox/tenancy/models/contacts.py` (+2 -2) </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 filing a pull request. This helps avoid wasting time and effort on something that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WE BE CLOSED AUTOMATICALLY. Specify your assigned issue number on the line below. --> ### Fixes: #10491 <!-- Please include a summary of the proposed changes below. --> @jeremystretch I wasn't sure if there were any side-effects from this str change. The error handler is at https://github.com/netbox-community/netbox/blob/develop/netbox/utilities/error_handlers.py#L12 For contacts since this is the side the error happens on the protected_objects str is showing the wrong end of the link. I think changing str to show self.object would break it in other places so showing both sides of the connection in the str seemed like the best approach? --- <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:03 +01:00
adam closed this issue 2025-12-29 23:20:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13647