Skip to content

Commit

Permalink
chore(admin): fix #942 Role Count for all Sites
Browse files Browse the repository at this point in the history
Signed-off-by: David Wallace <[email protected]>
  • Loading branch information
MyPyDavid committed Jun 4, 2024
1 parent 065d195 commit 1243a49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rdmo/accounts/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class RoleAdmin(admin.ModelAdmin):
def get_queryset(self, request):
return Role.objects.prefetch_related(
'member', 'manager', 'editor', 'reviewer').annotate(
Count('member'), Count('manager'), Count('editor'), Count('reviewer'),
Count('member', distinct=True), Count('manager', distinct=True),
Count('editor', distinct=True), Count('reviewer', distinct=True),
sites_count=Value(Site.objects.count())
)

Expand Down

0 comments on commit 1243a49

Please sign in to comment.