diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-16 01:16:52 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-16 01:16:52 -0400 |
commit | 7aabbe788bb4e26ee9c7cfc0e18692b487e11099 (patch) | |
tree | e1032beb86e35caafb164e694d2aa7e2e9664de2 /packages | |
parent | 046e6c8b6152a8142ed838e5c406cc04c18f2533 (diff) | |
parent | 155bf43a28e404f327a7bcff214c22e212627673 (diff) |
Merge branch 'archweb-generic'
Diffstat (limited to 'packages')
-rw-r--r-- | packages/templatetags/jinja2.py | 1 | ||||
-rw-r--r-- | packages/views/search.py | 17 |
2 files changed, 10 insertions, 8 deletions
diff --git a/packages/templatetags/jinja2.py b/packages/templatetags/jinja2.py index a07f87bd..f0b42a09 100644 --- a/packages/templatetags/jinja2.py +++ b/packages/templatetags/jinja2.py @@ -88,5 +88,4 @@ def flag_unfree(package): } return link_encode(url, data) - # vim: set ts=4 sw=4 et: diff --git a/packages/views/search.py b/packages/views/search.py index 0b776d79..e4cd0423 100644 --- a/packages/views/search.py +++ b/packages/views/search.py @@ -6,6 +6,7 @@ from django.db.models import Q from django.http import HttpResponse from django.views.generic import ListView +from devel.models import UserProfile from main.models import Package, Arch, Repo from main.utils import empty_response, make_choice from ..models import PackageRelation @@ -36,14 +37,16 @@ class PackageSearchForm(forms.Form): self.fields['arch'].choices = make_choice( [arch.name for arch in Arch.objects.all()]) self.fields['q'].widget.attrs.update({"size": "30"}) - maints = User.objects.filter(is_active=True).order_by( + + profile_ids = UserProfile.allowed_repos.through.objects.values('userprofile_id') + people = User.objects.filter( + is_active=True, userprofile__id__in=profile_ids).order_by( 'first_name', 'last_name') - self.fields['maintainer'].choices = \ - [('', 'All'), ('orphan', 'Orphan')] + \ - [(m.username, m.get_full_name()) for m in maints] - self.fields['packager'].choices = \ - [('', 'All'), ('unknown', 'Unknown')] + \ - [(m.username, m.get_full_name()) for m in maints] + people = [('', 'All'), ('orphan', 'Orphan')] + \ + [(p.username, p.get_full_name()) for p in people] + + self.fields['maintainer'].choices = people + self.fields['packager'].choices = people def exact_matches(self): # only do exact match search if 'q' is sole parameter |