only include soundfiles that are podcastable
authorFrédéric Péters <fpeters@0d.be>
Wed, 20 May 2015 11:51:17 +0000 (13:51 +0200)
committerFrédéric Péters <fpeters@0d.be>
Wed, 20 May 2015 11:51:17 +0000 (13:51 +0200)
panikombo/views.py

index 47262ad..7af24d7 100644 (file)
@@ -7,7 +7,7 @@ class SoundFilesView(django_select2.views.Select2View):
     def get_results(self, request, terms, page, context):
         queryset = SoundFile.objects.all()
         for term in terms.split():
-            queryset = queryset.filter(Q(title__icontains=term) |
+            queryset = queryset.filter(podcastable=True).filter(Q(title__icontains=term) |
                     Q(episode__title__icontains=term) |
                     Q(episode__emission__title__icontains=term))
         def fmt(soundfile):