Skip to content

Commit

Permalink
Fixes netbox-community#8196: Fix IndexError exception when viewing la…
Browse files Browse the repository at this point in the history
…rge IPv6 prefixes in UI
  • Loading branch information
jeremystretch authored and larsks committed Mar 8, 2022
1 parent f16a914 commit 8af8f61
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/release-notes/version-3.1.md
Expand Up @@ -9,8 +9,9 @@

### Bug Fixes

* [#8191](https://github.com/netbox-community/netbox/issues/8191) - Fix return URL when adding IP addresses to VM interfaces
* [#8187](https://github.com/netbox-community/netbox/issues/8187) - Fix rendering of tags column in object tables
* [#8191](https://github.com/netbox-community/netbox/issues/8191) - Fix return URL when adding IP addresses to VM interfaces
* [#8196](https://github.com/netbox-community/netbox/issues/8196) - Fix IndexError exception when viewing large IPv6 prefixes in UI

---

Expand Down
12 changes: 11 additions & 1 deletion netbox/templates/ipam/prefix.html
@@ -1,4 +1,5 @@
{% extends 'ipam/prefix/base.html' %}
{% load humanize %}
{% load helpers %}
{% load plugins %}

Expand Down Expand Up @@ -124,9 +125,18 @@ <h5 class="card-header">Addressing</h5>
<a href="{% url 'ipam:prefix_ipaddresses' pk=object.pk %}">{{ child_ip_count }}</a>
</td>
</tr>
{% endwith %}
{% with available_count=object.get_available_ips.size %}
<tr>
<th scope="row">Available IPs</th>
<td>{{ object.get_available_ips|length }}</td>
<td>
{# Use human-friendly words for counts greater than one million #}
{% if available_count > 1000000 %}
{{ available_count|intword }}
{% else %}
{{ available_count|intcomma }}
{% endif %}
</td>
</tr>
{% endwith %}
<tr>
Expand Down

0 comments on commit 8af8f61

Please sign in to comment.