Uses class method to get list of instance admins
Re-writing this query over and over is a bad approach
This commit is contained in:
parent
ac7be43e82
commit
6947f3b787
4 changed files with 11 additions and 11 deletions
|
@ -19,9 +19,7 @@ def about(request):
|
|||
"status_count": models.Status.objects.filter(
|
||||
user__local=True, deleted=False
|
||||
).count(),
|
||||
"admins": models.User.objects.filter(
|
||||
groups__name__in=["admin", "moderator"]
|
||||
).distinct(),
|
||||
"admins": models.User.admins(),
|
||||
"version": settings.VERSION,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue