Allow unrestricted access to assigned tags

This commit is contained in:
Jeremy Stretch 2020-06-16 14:59:22 -04:00
parent efed2bc262
commit 067e89f6a0
2 changed files with 7 additions and 3 deletions

View File

@ -585,8 +585,12 @@ class TagFilterField(forms.MultipleChoiceField):
def __init__(self, model, *args, **kwargs):
def get_choices():
tags = model.tags.annotate(count=Count('extras_taggeditem_items')).order_by('name')
return [(str(tag.slug), '{} ({})'.format(tag.name, tag.count)) for tag in tags]
tags = model.tags.all().unrestricted().annotate(
count=Count('extras_taggeditem_items')
).order_by('name')
return [
(str(tag.slug), '{} ({})'.format(tag.name, tag.count)) for tag in tags
]
# Choices are fetched each time the form is initialized
super().__init__(label='Tags', choices=get_choices, required=False, *args, **kwargs)

View File

@ -151,7 +151,7 @@ class TagColumn(tables.TemplateColumn):
Display a list of tags assigned to the object.
"""
template_code = """
{% for tag in value.all %}
{% for tag in value.all.unrestricted %}
{% include 'utilities/templatetags/tag.html' %}
{% empty %}
<span class="text-muted">&mdash;</span>