Fixes #6108: Do not infer tenant assignment from parent objects for prefixes, IP addresses

This commit is contained in:
jeremystretch 2021-04-08 13:50:06 -04:00
parent ae3527df16
commit 03b3f5937f
2 changed files with 9 additions and 20 deletions

View File

@ -14,6 +14,7 @@
* [#5805](https://github.com/netbox-community/netbox/issues/5805) - Fix missing custom field filters for cables, rack reservations * [#5805](https://github.com/netbox-community/netbox/issues/5805) - Fix missing custom field filters for cables, rack reservations
* [#6073](https://github.com/netbox-community/netbox/issues/6073) - Permit users to manage their own REST API tokens without needing explicit permission * [#6073](https://github.com/netbox-community/netbox/issues/6073) - Permit users to manage their own REST API tokens without needing explicit permission
* [#6081](https://github.com/netbox-community/netbox/issues/6081) - Fix interface connections REST API endpoint * [#6081](https://github.com/netbox-community/netbox/issues/6081) - Fix interface connections REST API endpoint
* [#6108](https://github.com/netbox-community/netbox/issues/6108) - Do not infer tenant assignment from parent objects for prefixes, IP addresses
--- ---

View File

@ -109,18 +109,6 @@ VLAN_MEMBER_TAGGED = """
{% endif %} {% endif %}
""" """
TENANT_LINK = """
{% if record.tenant %}
<a href="{% url 'tenancy:tenant' slug=record.tenant.slug %}" title="{{ record.tenant.description }}">{{ record.tenant }}</a>
{% elif record.vrf.tenant %}
<a href="{% url 'tenancy:tenant' slug=record.vrf.tenant.slug %}" title="{{ record.vrf.tenant.description }}">{{ record.vrf.tenant }}</a>*
{% elif object.tenant %}
<a href="{% url 'tenancy:tenant' slug=object.tenant.slug %}" title="{{ object.tenant.description }}">{{ object.tenant }}</a>
{% else %}
&mdash;
{% endif %}
"""
# #
# VRFs # VRFs
@ -210,8 +198,8 @@ class AggregateTable(BaseTable):
prefix = tables.LinkColumn( prefix = tables.LinkColumn(
verbose_name='Aggregate' verbose_name='Aggregate'
) )
tenant = tables.TemplateColumn( tenant = tables.Column(
template_code=TENANT_LINK linkify=True
) )
date_added = tables.DateColumn( date_added = tables.DateColumn(
format="Y-m-d", format="Y-m-d",
@ -281,8 +269,8 @@ class PrefixTable(BaseTable):
template_code=VRF_LINK, template_code=VRF_LINK,
verbose_name='VRF' verbose_name='VRF'
) )
tenant = tables.TemplateColumn( tenant = tables.Column(
template_code=TENANT_LINK linkify=True
) )
site = tables.Column( site = tables.Column(
linkify=True linkify=True
@ -349,8 +337,8 @@ class IPAddressTable(BaseTable):
default=AVAILABLE_LABEL default=AVAILABLE_LABEL
) )
role = ChoiceFieldColumn() role = ChoiceFieldColumn()
tenant = tables.TemplateColumn( tenant = tables.Column(
template_code=TENANT_LINK linkify=True
) )
assigned_object = tables.Column( assigned_object = tables.Column(
linkify=True, linkify=True,
@ -430,8 +418,8 @@ class InterfaceIPAddressTable(BaseTable):
verbose_name='VRF' verbose_name='VRF'
) )
status = ChoiceFieldColumn() status = ChoiceFieldColumn()
tenant = tables.TemplateColumn( tenant = tables.Column(
template_code=TENANT_LINK linkify=True
) )
actions = ButtonsColumn( actions = ButtonsColumn(
model=IPAddress model=IPAddress