diff options
author | Dan McGee <dan@archlinux.org> | 2014-12-02 15:11:58 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2014-12-02 15:11:58 -0600 |
commit | 92437ffb21b42c5e2b58af496448f64e8292442b (patch) | |
tree | 182c4a4344a3a7c0520beb86d367070c8bad108c /devel | |
parent | dca00e7aabc057d0069606fec6261cc571ddcb71 (diff) |
Filter maintainer list on developer dashboard
Thank Johannes for this one. Only reason I didn't take his patches is
for consistency with the way we were already doing this on the master
keys page.
Noticed-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rw-r--r-- | devel/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/devel/utils.py b/devel/utils.py index 0cafbb59..68ae5bdc 100644 --- a/devel/utils.py +++ b/devel/utils.py @@ -5,13 +5,16 @@ from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.db import connection from django.db.models import Count, Q +from devel.models import UserProfile from main.utils import cache_function from main.models import Package from packages.models import PackageRelation @cache_function(283) def get_annotated_maintainers(): - maintainers = User.objects.filter(is_active=True).order_by( + profile_ids = UserProfile.allowed_repos.through.objects.values('userprofile_id') + maintainers = User.objects.filter( + is_active=True, userprofile__id__in=profile_ids).order_by( 'first_name', 'last_name') # annotate the maintainers with # of maintained and flagged packages |