summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-15 17:06:34 +0100
committerDan McGee <dan@archlinux.org>2011-03-15 17:06:34 +0100
commit2360e2c4bcb0fc873a60599165e7f24f20465786 (patch)
tree5b8506d7942dd056b8c2c0f62695678a71ceef16 /packages
parenta0ef88770f5fe318f38eaa7dc794727a507c797b (diff)
downloadarchweb-2360e2c4bcb0fc873a60599165e7f24f20465786.tar.gz
archweb-2360e2c4bcb0fc873a60599165e7f24f20465786.tar.xz
Only set limit if we have one, else default to 50
This was the cause of some pretty awesome performance headaches this morning. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/views.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/views.py b/packages/views.py
index 6239f01..70b3a84 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -207,7 +207,9 @@ def search(request, page=None):
lu = form.cleaned_data['last_update']
packages = packages.filter(last_update__gte=
datetime(lu.year, lu.month, lu.day, 0, 0))
- limit = form.cleaned_data['limit']
+
+ if form.cleaned_data['limit']:
+ limit = form.cleaned_data['limit']
else:
# Form had errors, don't return any results, just the busted form
packages = Package.objects.none()