diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-15 22:03:47 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-15 22:03:47 -0400 |
commit | 3c640cb94438dda317198843f5b498306a2bf989 (patch) | |
tree | 67ce7dc393383d5205a9e1fa56db3aa9ff18d893 /devel | |
parent | 2ea4e6f4d5245dd5e43c90d54635477c6e7dd6a7 (diff) | |
parent | 1a2709552704a91f9601a13c350153b3daf3a455 (diff) |
Merge tag 'release_2014-12-08' into archweb-generic
Minor fixes and package updates
Diffstat (limited to 'devel')
-rw-r--r-- | devel/utils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/devel/utils.py b/devel/utils.py index eaa7d07e..3326987a 100644 --- a/devel/utils.py +++ b/devel/utils.py @@ -6,13 +6,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 @@ -43,7 +46,8 @@ SELECT pr.user_id, COUNT(*), COUNT(p.flag_date) m.flagged_count = flag_count.get(m.id, 0) m.updated_count = update_count.get(m.id, 0) - return maintainers + # force non-QS context, otherwise pickling doesn't work + return list(maintainers) def ignore_does_not_exist(func): |