]> git.0d.be Git - django-panik-nonstop.git/commitdiff
exclude tracks with missing creation timestamp from recent page
authorFrédéric Péters <fpeters@0d.be>
Tue, 3 Oct 2017 15:15:56 +0000 (17:15 +0200)
committerFrédéric Péters <fpeters@0d.be>
Tue, 3 Oct 2017 15:16:33 +0000 (17:16 +0200)
nonstop/views.py

index 91e2cba1cb22b920cdb3260c6f8442493b46143e..0068923f05bae9386178270584d5040aa9d1bbc8 100644 (file)
@@ -223,7 +223,7 @@ class RecentTracksView(ListView):
     template_name = 'nonstop/recent_tracks.html'
 
     def get_queryset(self):
-        return Track.objects.all().order_by('-creation_timestamp')[:20]
+        return Track.objects.exclude(creation_timestamp__isnull=True).order_by('-creation_timestamp')[:20]
 
     def post(self, request, *args, **kwargs):
         for track_id in request.POST.getlist('track'):