diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html
index 1509f35cb2..24889972b8 100644
--- a/netbox/templates/ipam/ipaddress.html
+++ b/netbox/templates/ipam/ipaddress.html
@@ -65,10 +65,11 @@
{% block title %}{{ ipaddress }}{% endblock %}
Tenant |
{% if ipaddress.tenant %}
+ {% if ipaddress.tenant.group %}
+ {{ ipaddress.tenant.group }}
+
+ {% endif %}
{{ ipaddress.tenant }}
- {% elif ipaddress.vrf.tenant %}
- {{ ipaddress.vrf.tenant }}
-
{% else %}
None
{% endif %}
diff --git a/netbox/templates/ipam/prefix.html b/netbox/templates/ipam/prefix.html
index 11c5fc405b..1b23284f4c 100644
--- a/netbox/templates/ipam/prefix.html
+++ b/netbox/templates/ipam/prefix.html
@@ -35,13 +35,6 @@
{% endif %}
{{ prefix.tenant }}
- {% elif prefix.vrf.tenant %}
- {% if prefix.vrf.tenant.group %}
- {{ prefix.vrf.tenant.group }}
-
- {% endif %}
- {{ prefix.vrf.tenant }}
-
{% else %}
None
{% endif %}
diff --git a/netbox/tenancy/views.py b/netbox/tenancy/views.py
index 99c4acc8a0..9020a8c19e 100644
--- a/netbox/tenancy/views.py
+++ b/netbox/tenancy/views.py
@@ -78,14 +78,8 @@ def get(self, request, slug):
'rackreservation_count': RackReservation.objects.filter(tenant=tenant).count(),
'device_count': Device.objects.filter(tenant=tenant).count(),
'vrf_count': VRF.objects.filter(tenant=tenant).count(),
- 'prefix_count': Prefix.objects.filter(
- Q(tenant=tenant) |
- Q(tenant__isnull=True, vrf__tenant=tenant)
- ).count(),
- 'ipaddress_count': IPAddress.objects.filter(
- Q(tenant=tenant) |
- Q(tenant__isnull=True, vrf__tenant=tenant)
- ).count(),
+ 'prefix_count': Prefix.objects.filter(tenant=tenant).count(),
+ 'ipaddress_count': IPAddress.objects.filter(tenant=tenant).count(),
'vlan_count': VLAN.objects.filter(tenant=tenant).count(),
'circuit_count': Circuit.objects.filter(tenant=tenant).count(),
'virtualmachine_count': VirtualMachine.objects.filter(tenant=tenant).count(),
|