Skip to content

Conversation

@aq5747
Copy link
Contributor

@aq5747 aq5747 commented Sep 5, 2025

Fixes: #20217

Fixes an issue where the VLANs table under a VLAN Group will display a clickable 0 VLANs available button when the final VLAN in the range is in use.

@jnovinger jnovinger requested review from a team and jeremystretch and removed request for a team September 5, 2025 12:02

# Annotate any remaining available VLANs
if prev_vid < max_vid:
if prev_vid < max_vid and (available := max_vid - prev_vid - 1) > 0:
Copy link
Member

Choose a reason for hiding this comment

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

While this works, it's a bit confusing IMO. Would it not be sufficient to just account for the off-by-one error (and leave the value of available as is)?

Suggested change
if prev_vid < max_vid and (available := max_vid - prev_vid - 1) > 0:
if prev_vid < max_vid - 1:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point! I must have had some tunnel vision going on and didn't see the simpler, cleaner fix.

I'll revise it.

@aq5747 aq5747 requested a review from jeremystretch September 9, 2025 00:01
Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

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

Thanks @aq5747!

@jeremystretch jeremystretch merged commit 1034f73 into netbox-community:main Sep 9, 2025
7 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 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.

VLAN Groups show "0 VLANS Available" following a range if the last VLAN in the range exists

2 participants