summaryrefslogtreecommitdiff
path: root/packages/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-07 21:50:13 -0600
committerDan McGee <dan@archlinux.org>2011-03-07 21:50:13 -0600
commit6a429a8d898d5f0789f5b5a3f2858c6578fa5227 (patch)
tree017e857cb1d5ab8838699ca1d37de576e25285e9 /packages/views.py
parente82a4d5b9c17fbc5ee63d14a1c87ef12718fa343 (diff)
Clean up current_query and preserve multiple args
When implementing search for multiple architectures or repositories, I didn't update this method to accomidate the new query parameters. Clean it up a bit by not appending/stripping the leading '?' anywhere but in the template itself, and ensure we can handle multiple of any parameter passed in. Fixes FS#23180. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views.py')
-rw-r--r--packages/views.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/views.py b/packages/views.py
index 59779fe4..3cef8226 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -168,12 +168,10 @@ class PackageSearchForm(forms.Form):
[(m.username, m.get_full_name()) for m in maints]
def search(request, page=None):
- current_query = '?'
limit = 50
packages = Package.objects.select_related('arch', 'repo')
if request.GET:
- current_query += request.GET.urlencode()
form = PackageSearchForm(data=request.GET)
if form.is_valid():
if form.cleaned_data['repo']:
@@ -208,12 +206,14 @@ def search(request, page=None):
else:
form = PackageSearchForm()
- page_dict = {'search_form': form,
- 'current_query': current_query
- }
if packages.count() == 1:
return redirect(packages[0])
+ current_query = request.GET.urlencode()
+ page_dict = {
+ 'search_form': form,
+ 'current_query': current_query
+ }
allowed_sort = ["arch", "repo", "pkgname", "last_update", "flag_date"]
allowed_sort += ["-" + s for s in allowed_sort]
sort = request.GET.get('sort', None)