Order before taking a slice of the QS

This commit is contained in:
2011-10-24 08:55:02 +01:00
parent 33e2b38efe
commit c6f0060d40

View File

@@ -160,12 +160,13 @@ class HrAdminApplications(ListView):
# If a invalid order as been passed, correct it
if not order in ['id', 'corporation__name', 'character__name']:
order = 'id'
apps = apps.order_by(order)
# If we've got a short search string, only get the first 50
if query and len(query) < 3:
apps = apps[:50]
return apps.order_by(order)
return apps
class HrUpdateApplication(BaseDetailView):