[PR #19949] [MERGED] Closes #18936: add color name support for cable bulk import #15766

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19949
Author: @Jathn
Created: 7/24/2025
Status: Merged
Merged: 7/24/2025
Merged by: @arthanson

Base: mainHead: 18936-import-cable-color-names


📝 Commits (1)

  • 265c02d Closes #18936: add color name support for cable bulk import

📊 Changes

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

View changed files

📝 netbox/dcim/forms/bulk_import.py (+28 -1)

📄 Description

Closes: #18936

The changes made allows for colors to be imported as either hex code or with the label name.

Changes made:

  • Make "color" a custom field instead of using the built in Django field. It now allows longer names for the colors (previously only 6 chars matching that of a hex code.)
  • The given color is matched against the labels of ColorChoices. In case of a hex code, the behavior is the same as previous implementation and all test cases still pass.
  • The exception raised if the color is over six characters and not in ColorChoices is now separate from that of the base case.

Note: It seems that color choices in general are limited to the set defined in ColorChoices, however I can't seem to find these documented anywhere. Didn't include it as it is out of scope for this issue.


🔄 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/19949 **Author:** [@Jathn](https://github.com/Jathn) **Created:** 7/24/2025 **Status:** ✅ Merged **Merged:** 7/24/2025 **Merged by:** [@arthanson](https://github.com/arthanson) **Base:** `main` ← **Head:** `18936-import-cable-color-names` --- ### 📝 Commits (1) - [`265c02d`](https://github.com/netbox-community/netbox/commit/265c02dcb6adf21f3df8d2c0b05d2232ed926055) Closes #18936: add color name support for cable bulk import ### 📊 Changes **1 file changed** (+28 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/forms/bulk_import.py` (+28 -1) </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. --> ### Closes: #18936 <!-- Please include a summary of the proposed changes below. --> The changes made allows for colors to be imported as either hex code or with the label name. Changes made: - Make "color" a custom field instead of using the built in Django field. It now allows longer names for the colors (previously only 6 chars matching that of a hex code.) - The given color is matched against the labels of ColorChoices. In case of a hex code, the behavior is the same as previous implementation and all test cases still pass. - The exception raised if the color is over six characters and not in ColorChoices is now separate from that of the base case. *Note: It seems that color choices in general are limited to the set defined in ColorChoices, however I can't seem to find these documented anywhere. Didn't include it as it is out of scope for this issue.* --- <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-30 00:23:56 +01:00
adam closed this issue 2025-12-30 00:23:56 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15766