Skip to content

fix: get_color_color() on Strand + Tube for TIA-598 badge rendering (v0.3.5)#23

Merged
iamjohnnymac merged 1 commit into
mainfrom
fix/strand-color-helpers
May 19, 2026
Merged

fix: get_color_color() on Strand + Tube for TIA-598 badge rendering (v0.3.5)#23
iamjohnnymac merged 1 commit into
mainfrom
fix/strand-color-helpers

Conversation

@iamjohnnymac

Copy link
Copy Markdown
Owner

Two-line model fix. v0.3.4 CSS was correct but never fired — model needed the helper method NetBox's ChoiceFieldColumn looks for.

…in their actual colour (v0.3.5)

v0.3.4 added CSS overrides for text-bg-blue/black/white but they had
no effect. Root cause: NetBox's ChoiceFieldColumn (and the badge
template tag) look up the colour by calling get_<field>_color() on
the model — neither Strand nor Tube defined that method, so every
strand colour rendered as text-bg-secondary (grey).

Two-line fix per model: return TIA598ColorChoices.colors.get(self.color).
Blue now renders blue, Orange orange, Brown brown, etc. — strand
colour codes are functionally identifiable at a glance again.
@iamjohnnymac iamjohnnymac merged commit 92902ee into main May 19, 2026
2 checks passed
@iamjohnnymac iamjohnnymac deleted the fix/strand-color-helpers branch May 19, 2026 01:00
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.

1 participant