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
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.

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