Skip to content

Conversation

@pheus
Copy link
Contributor

@pheus pheus commented Oct 2, 2025

Fixes: #20475

Summary
Collapse singleton VLAN ID ranges when rendering/storing display strings.
Input 1-5,10,20-30 remains 1-5,10,20-30 instead of 1-5,10-10,20-30.

Implementation
Update utilities.ranges_to_string() to emit a bare integer when start == end.

Before → After
1-5,10-10,20-301-5,10,20-30

@pheus

This comment was marked as outdated.

@pheus pheus marked this pull request as ready for review October 2, 2025 20:05
@jeremystretch jeremystretch requested review from a team and arthanson and removed request for a team October 2, 2025 20:53
Updates the `ranges_to_string` function to handle single-value ranges
and improve string representation. Refines the formatting logic to
include isolated values when the lower and upper bounds of a range
are identical.

Fixes netbox-community#20475
@pheus pheus force-pushed the 20475-vlangroup-collapse-singletons branch from dc92fb2 to f5b8077 Compare October 2, 2025 21:15
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 @pheus !

@arthanson arthanson merged commit 51528ae into netbox-community:main Oct 7, 2025
7 checks passed
@pheus pheus deleted the 20475-vlangroup-collapse-singletons branch October 8, 2025 09:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VLANGroup: Single VLAN IDs render as n-n after save

2 participants