Fixes collecting list of admins

This commit is contained in:
Mouse Reeve 2022-11-17 14:38:05 -08:00
parent 7e10b0cd1f
commit b1c6781036
2 changed files with 6 additions and 5 deletions

View file

@ -244,9 +244,10 @@ class User(OrderedCollectionPageMixin, AbstractUser):
def admins(cls): def admins(cls):
"""Get a queryset of the admins for this instance""" """Get a queryset of the admins for this instance"""
return cls.objects.filter( return cls.objects.filter(
models.Q(user_permissions__name__in=["moderate_user", "moderate_post"]) models.Q(groups__name__in=["moderator", "admin"])
| models.Q(is_superuser=True) | models.Q(is_superuser=True),
) is_active=True,
).distinct()
def update_active_date(self): def update_active_date(self):
"""this user is here! they are doing things!""" """this user is here! they are doing things!"""

View file

@ -11,7 +11,7 @@
{% block about_content %} {% block about_content %}
{# seven day cache #} {# seven day cache #}
{% cache 604800 about_page %} {% cache 604800 about_page_superlatives %}
{% get_book_superlatives as superlatives %} {% get_book_superlatives as superlatives %}
<section class=" pb-4"> <section class=" pb-4">
@ -97,6 +97,7 @@
</p> </p>
</section> </section>
{% endcache %}
<section class="block"> <section class="block">
<header class="content"> <header class="content">
@ -145,5 +146,4 @@
</div> </div>
</section> </section>
{% endcache %}
{% endblock %} {% endblock %}