Skip to content

Closes #18936: add color name support for cable bulk import #19949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Jathn
Copy link
Contributor

@Jathn Jathn commented Jul 24, 2025

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.

@arthanson arthanson requested review from a team and arthanson and removed request for a team July 24, 2025 16:07
@arthanson arthanson added this to the v4.3.5 milestone Jul 24, 2025
Copy link
Collaborator

@arthanson arthanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Jathn !

@arthanson arthanson merged commit ffa9a52 into netbox-community:main Jul 24, 2025
3 checks passed
@jnovinger jnovinger removed this from the v4.3.5 milestone Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import cables with color name instead of hex code
3 participants