summaryrefslogtreecommitdiff
path: root/packages/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-08-13 11:05:48 -0500
committerDan McGee <dan@archlinux.org>2010-08-13 11:05:48 -0500
commit9300b43b792565805b655bcddf2cbf7982a11dfe (patch)
treede6412e22e28729548413d8e335c14870632be56 /packages/views.py
parentc93ed3f6fe3ebe322f3bc0ad269b83a607fb1b53 (diff)
Show maintainer full names in search dropdown
Instead of just showing usernames. It is especially helpful since we have many similarly named developers at this point. In addition, only show active developers/TUs and remove the rest from the list. Also remove some cargo-cult code that set widget.choices; this is not necesary as the widget automatically grabs the choices from the field. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views.py')
-rw-r--r--packages/views.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/packages/views.py b/packages/views.py
index 9f7672e0..277b7900 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -124,17 +124,15 @@ class PackageSearchForm(forms.Form):
def __init__(self, *args, **kwargs):
super(PackageSearchForm, self).__init__(*args, **kwargs)
- self.fields['repo'].choices = self.fields[
- 'repo'].widget.choices = [('', 'All')] + make_choice(
+ self.fields['repo'].choices = [('', 'All')] + make_choice(
[repo.name for repo in Repo.objects.all()])
- self.fields['arch'].choices = self.fields[
- 'arch'].widget.choices = [('', 'All')] + make_choice(
+ self.fields['arch'].choices = [('', 'All')] + make_choice(
[arch.name for arch in Arch.objects.all()])
self.fields['q'].widget.attrs.update({"size": "30"})
- self.fields['maintainer'].choices = self.fields[
- 'maintainer'].widget.choices = [
- ('', 'All'), ('orphan', 'Orphan')] + make_choice(
- [m.username for m in User.objects.order_by('username')])
+ maints = User.objects.filter(is_active=True).order_by('username')
+ self.fields['maintainer'].choices = \
+ [('', 'All'), ('orphan', 'Orphan')] + \
+ [(m.username, m.get_full_name()) for m in maints]
def search(request, page=None):
current_query = '?'