From 1ed152cd49874cc9896c8c10cf9b3f2280a06693 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 2 Jul 2020 16:25:13 -0400 Subject: [PATCH] Fix unrestricted queries for Tags --- netbox/templates/dcim/device.html | 2 +- netbox/templates/dcim/inc/interface.html | 2 +- netbox/templates/extras/inc/tags_panel.html | 2 +- netbox/utilities/utils.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index c1da53423..6bdf26071 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -101,7 +101,7 @@ {% if perms.dcim.napalm_read_device %} diff --git a/netbox/templates/dcim/inc/interface.html b/netbox/templates/dcim/inc/interface.html index 75869db52..b8d090231 100644 --- a/netbox/templates/dcim/inc/interface.html +++ b/netbox/templates/dcim/inc/interface.html @@ -31,7 +31,7 @@ {% if iface.description %} {{ iface.description }}
{% endif %} - {% for tag in iface.tags.all %} + {% for tag in iface.tags.all.unrestricted %} {% tag tag %} {% empty %} {% if not iface.description %}—{% endif %} diff --git a/netbox/templates/extras/inc/tags_panel.html b/netbox/templates/extras/inc/tags_panel.html index 2024d4ab7..d03932354 100644 --- a/netbox/templates/extras/inc/tags_panel.html +++ b/netbox/templates/extras/inc/tags_panel.html @@ -4,7 +4,7 @@ Tags
- {% for tag in tags.all %} + {% for tag in tags.all.unrestricted %} {% tag tag url %} {% empty %} No tags assigned diff --git a/netbox/utilities/utils.py b/netbox/utilities/utils.py index 4c07f5520..d1b4abb44 100644 --- a/netbox/utilities/utils.py +++ b/netbox/utilities/utils.py @@ -215,7 +215,7 @@ def prepare_cloned_fields(instance): # Copy tags if is_taggable(instance): - params['tags'] = ','.join([t.name for t in instance.tags.all()]) + params['tags'] = ','.join([t.name for t in instance.tags.all().unrestricted()]) # Concatenate parameters into a URL query string param_string = '&'.join(