Fixes collecting list of admins
This commit is contained in:
parent
7e10b0cd1f
commit
b1c6781036
2 changed files with 6 additions and 5 deletions
|
@ -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!"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue