From b1c67810368c9c87e64f1efa2b82c53469912c66 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 17 Nov 2022 14:38:05 -0800 Subject: [PATCH] Fixes collecting list of admins --- bookwyrm/models/user.py | 7 ++++--- bookwyrm/templates/about/about.html | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index 5f7b00d87..e48d86572 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -244,9 +244,10 @@ class User(OrderedCollectionPageMixin, AbstractUser): def admins(cls): """Get a queryset of the admins for this instance""" return cls.objects.filter( - models.Q(user_permissions__name__in=["moderate_user", "moderate_post"]) - | models.Q(is_superuser=True) - ) + models.Q(groups__name__in=["moderator", "admin"]) + | models.Q(is_superuser=True), + is_active=True, + ).distinct() def update_active_date(self): """this user is here! they are doing things!""" diff --git a/bookwyrm/templates/about/about.html b/bookwyrm/templates/about/about.html index 481ecda99..c446e0cf2 100644 --- a/bookwyrm/templates/about/about.html +++ b/bookwyrm/templates/about/about.html @@ -11,7 +11,7 @@ {% block about_content %} {# seven day cache #} -{% cache 604800 about_page %} +{% cache 604800 about_page_superlatives %} {% get_book_superlatives as superlatives %}
@@ -97,6 +97,7 @@

+{% endcache %}
@@ -145,5 +146,4 @@
-{% endcache %} {% endblock %}