From 6569d3ce96bb3e77eef39e4e4149f26398e06f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Marti=CC=81n?= Date: Sun, 24 Aug 2014 17:59:43 +0200 Subject: [PATCH] User PK = 1 shouldn't show up in any result --- shelfzilla/apps/homepage/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shelfzilla/apps/homepage/views.py b/shelfzilla/apps/homepage/views.py index a4636ca..34c94ea 100644 --- a/shelfzilla/apps/homepage/views.py +++ b/shelfzilla/apps/homepage/views.py @@ -13,7 +13,7 @@ class HomepageView(View): data = {} from datetime import datetime # TOP 5 - data['TOP_5_COLLECTORS'] = User.objects.all()\ + data['TOP_5_COLLECTORS'] = User.objects.filter(pk__gt=1)\ .annotate(num_volumes=Count('have_volumes'))\ .order_by('-num_volumes')[:5]