mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
TagFilter should call unrestricted() on its queryset
This commit is contained in:
@ -102,7 +102,7 @@ class TagFilter(django_filters.ModelMultipleChoiceFilter):
|
|||||||
kwargs.setdefault('field_name', 'tags__slug')
|
kwargs.setdefault('field_name', 'tags__slug')
|
||||||
kwargs.setdefault('to_field_name', 'slug')
|
kwargs.setdefault('to_field_name', 'slug')
|
||||||
kwargs.setdefault('conjoined', True)
|
kwargs.setdefault('conjoined', True)
|
||||||
kwargs.setdefault('queryset', Tag.objects.all())
|
kwargs.setdefault('queryset', Tag.objects.unrestricted())
|
||||||
|
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
@ -596,7 +596,7 @@ class TagFilterField(forms.MultipleChoiceField):
|
|||||||
|
|
||||||
def __init__(self, model, *args, **kwargs):
|
def __init__(self, model, *args, **kwargs):
|
||||||
def get_choices():
|
def get_choices():
|
||||||
tags = model.tags.annotate(
|
tags = model.tags.all().unrestricted().annotate(
|
||||||
count=Count('extras_taggeditem_items')
|
count=Count('extras_taggeditem_items')
|
||||||
).order_by('name')
|
).order_by('name')
|
||||||
return [
|
return [
|
||||||
|
@ -151,7 +151,7 @@ class TagColumn(tables.TemplateColumn):
|
|||||||
Display a list of tags assigned to the object.
|
Display a list of tags assigned to the object.
|
||||||
"""
|
"""
|
||||||
template_code = """
|
template_code = """
|
||||||
{% for tag in value.all %}
|
{% for tag in value.all.unrestricted %}
|
||||||
{% include 'utilities/templatetags/tag.html' %}
|
{% include 'utilities/templatetags/tag.html' %}
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<span class="text-muted">—</span>
|
<span class="text-muted">—</span>
|
||||||
|
Reference in New Issue
Block a user